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.

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
Get Tasks

https://api.appmixer.com/people-task/tasks
Return all tasks of a user.
Request
Response
Request
Query Parameters
limit
optional
number
Maximum items returned. Default is 100. Useful for paging.
offset
optional
number
The index of the first item returned. Default is 0. Useful for paging.
projection
optional
string
Exclude task object properties. Example: "-description".
sort
optional
string
Sorting parameter. Can be any task object property followed by semicolon and 1 (ascending), -1 (descending). Example: "decisionBy:-1".
filter
optional
string
Filter tasks by their property values. Example: "status:pending" returns only pending tasks.
pattern
optional
string
Filter tasks by a search term (searches the tasks title).
role
optional
string
Filter tasks by role ("approver" or "requester").
Response
200: OK
[{
"approver": "approver@example.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "requester@example.com",
"status": "pending",
"public": false,
"title": "Example title",
"id": "5da9ed9ff29cd51c5fa27380"
}, {
"approver": "approver@example.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "requester@example.com",
"status": "pending",
"public": true,
"title": "Example title",
"id": "5da9ed9ff29cd51c5fa27380"
}]

get
Get Task Count

https://api.appmixer.com/people-task/tasks-count
Get the number of all tasks of a user.
Request
Response
Request
Query Parameters
filter
optional
string
Filter tasks by their property values. Example: "status:pending" returns only pending tasks.
pattern
optional
string
Filter tasks by a search term (searches the tasks title).
role
optional
string
Filter tasks by role ("approver" or "requester").
Response
200: OK
{
"count": 23
}

get
Get Task

https://api.appmixer.com/people-task/tasks/:id
Get a task detail.
Request
Response
Request
Path Parameters
id
optional
string
ID of a task.
Response
200: OK
{
"approver": "approver@example.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "requester@example.com",
"status": "pending",
"public": true,
"title": "Example title",
"id": "5da9ed9ff29cd51c5fa27380"
}

post
Create a New Task

https://api.appmixer.com/people-task/tasks
Request
Response
Request
Body Parameters
decisionBy
optional
string
Date by which the task is due. ISO 8601 format.
public
optional
boolean
Determines whether this task is public, i.e. it can be seen, approved or rejected without the user being signed-in to Appmixer (without sending the user token in the Authorization header).
status
required
string
Status of the task. One of "pending", "approved" or "rejected".
description
optional
string
The description of the task.
title
required
string
The title of the task.
requester
required
string
Requester's email address.
approver
required
string
Approver's email address.
Response
200: OK
{
"approver": "approver@example.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "requester@example.com",
"status": "pending",
"public": true,
"title": "Example title",
"id": "5da9ed9ff29cd51c5fa27380"
}

post
Register a Webhook for a Task

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
Response
Request
Body Parameters
url
required
string
URL to be triggered when the status of the task changes.
taskId
required
string
ID of a task.
Response
200: OK
{
"url": "https://api.appmixer.com/flows/551945f2-6bbb-4ea4-a792-fb3635943372/components/a54b47fa-e7ce-463f-87bc-715ceb612947?correlationId=ee325876-4b3e-4537-9a12-58b4929f6cd8&correlationInPort=task",
"taskId": "1234",
"status": "pending",
"id": "5da9ee4cf29cd51c5fa27381"
}

get
Delete a Webhook

https://api.appmixer.com/people-task/webhooks/:id
Delete a previously registered webhook.
Request
Response
Request
Path Parameters
id
required
string
Webhook ID, i.e. the id returned from the /people-task/webhooks when registering a new webhook.
Response
200: OK
‚Äč

put
Edit a Task

https://api.appmixer.com/people-task/tasks/:id
Edit an existing task.
Request
Response
Request
Path Parameters
id
required
string
Id of a task.
Body Parameters
decisionBy
optional
string
Date by which the task is due. ISO 8601 format.
public
optional
boolean
Determines whether this task is public, i.e. it can be seen, approved or rejected without the user being signed-in to Appmixer (without sending the user token in the Authorization header).
status
optional
string
The status of the task. One of "pending", "approved" or "rejected".
description
optional
string
The description of the task.
title
optional
string
The title of the task.
requester
optional
string
Requester's email address.
approver
optional
string
Approver's email address.
Response
200: OK
{
"approver": "approver@example.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "requester@example.com",
"status": "pending",
"public": true,
"title": "Example title",
"id": "5da9ed9ff29cd51c5fa27380"
}

put
Approve a Task

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.
Request
Response
Request
Path Parameters
id
required
string
ID of a task.
Response
200: OK
{
"id": "5da9ed9ff29cd51c5fa27380",
"approver": "e2etest@gmail.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "e2etest@gmail.com",
"status": "approved",
"public": true,
"title": "Example title"
}

put
Reject a Task

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.
Request
Response
Request
Path Parameters
id
required
string
ID of a task.
Response
200: OK
{
"id": "5da9ed9ff29cd51c5fa27380",
"approver": "e2etest@gmail.com",
"decisionBy": "2020-01-01 19:00:00",
"description": "Example description",
"requester": "e2etest@gmail.com",
"status": "rejected",
"public": true,
"title": "Example title"
}