People Task
The People Task Appmixer module provides an API that lets you create tasks that can be approved or rejected by other people. This module is used by the appmixer.ui.PeopleTask UI SDK module in combination with the appmixer.utils.tasks.RequestApproval and appmixer.utils.tasks.RequestApprovalEmail components. Please see the People Tasks tutorial for more details.
Each task carries an email address of the requester and approver of the task together with title, description and due date. Tasks can have registered webhooks that the Appmixer engine calls when the status of the task changes (pending -> approved and pending -> rejected). Components can register these webhooks and trigger their outputs based on the result of the task resolution.
Get Tasks
GET
https://api.appmixer.com/people-task/tasks
Return all tasks of a user.
Query Parameters
secret
string
Approver or requester secret. This is the secret that you get in the approverSecret
or requesterSecret
property when you create a new task. This secret allows you to list tasks of any user for which you have the secret (instead of just the user identified by the token in the Authorization header).
limit
number
Maximum items returned. Default is 100. Useful for paging.
offset
number
The index of the first item returned. Default is 0. Useful for paging.
projection
string
Exclude task object properties. Example: "-description".
sort
string
Sorting parameter. Can be any task object property followed by semicolon and 1 (ascending), -1 (descending). Example: "decisionBy:-1".
filter
string
Filter tasks by their property values. Example: "status:pending" returns only pending tasks.
pattern
string
Filter tasks by a search term (searches the tasks title).
role
string
Filter tasks by role ("approver" or "requester").
Get Task Count
GET
https://api.appmixer.com/people-task/tasks-count
Get the number of all tasks of a user.
Query Parameters
secret
string
Approver or requester secret. This is the secret that you get in the approverSecret or requesterSecret property when you create a new task. This secret allows you to list tasks of any user for which you have the secret (instead of just the user identified by the token in the Authorization header).
filter
string
Filter tasks by their property values. Example: "status:pending" returns only pending tasks.
pattern
string
Filter tasks by a search term (searches the tasks title).
role
string
Filter tasks by role ("approver" or "requester").
Get Task
GET
https://api.appmixer.com/people-task/tasks/:id
Get a task detail.
Path Parameters
id
string
ID of a task.
Create a New Task
POST
https://api.appmixer.com/people-task/tasks
Request Body
decisionBy
string
Date by which the task is due. ISO 8601 format.
status
string
Status of the task. One of "pending", "approved" or "rejected".
description
string
The description of the task.
title
string
The title of the task.
requester
string
Requester's email address.
approver
string
Approver's email address.
Register a Webhook for a Task
POST
https://api.appmixer.com/people-task/webhooks
Register a new webhook URL for a task. Appmixer will send a POST request to this URL whenever the status of the task changes. This is usually done right after creating a new task so that you can get notified as soon as the task gets approved or rejected.
Request Body
url
string
URL to be triggered when the status of the task changes.
taskId
string
ID of a task.
Delete a Webhook
GET
https://api.appmixer.com/people-task/webhooks/:id
Delete a previously registered webhook.
Path Parameters
id
string
Webhook ID, i.e. the id
returned from the /people-task/webhooks when registering a new webhook.
Edit a Task
PUT
https://api.appmixer.com/people-task/tasks/:id
Edit an existing task.
Path Parameters
id
string
Id of a task.
Request Body
decisionBy
string
Date by which the task is due. ISO 8601 format.
status
string
The status of the task. One of "pending", "approved" or "rejected".
description
string
The description of the task.
title
string
The title of the task.
requester
string
Requester's email address.
approver
string
Approver's email address.
Approve a Task
PUT
https://api.appmixer.com/people-task/tasks/:id/approve
This endpoint approves a task triggering all the registered webhooks for this task announcing a new approved
status.
Path Parameters
id
string
ID of a task.
Request Body
secret
string
Approver secret. This is the secret that you get in the approverSecret
property when you create a new task. This secret allows you to approve a task of any user for which you have the secret.
Reject a Task
PUT
https://api.appmixer.com/people-task/tasks/:id/reject
This endpoint rejects a task triggering all the registered webhooks for this task announcing a new rejected
status.
Path Parameters
id
string
ID of a task.
Request Body
secret
string
Approver secret. This is the secret that you get in the approverSecret
property when you create a new task. This secret allows you to reject a task of any user for which you have the secret.
Last updated