You can use callbacks to ensure that after a task, or group of tasks has been completed, the task manager redirects the user to the desired place in your workflow or application.

The callback URL is the application or address to were the user will be routed after completing their tasks. The callback URL needs to be appended as a querystring parameter to the consumerLink URL received in the response after submitting the order.

Example:
https://todo.humanapi.co/?clientId=<client_id>&rq=<request_query>&callback=<callback_url>

where <callback_url> is the allowed callback URL.

📘

Note

Human API will need to whitelist the callback URL. Please reach out to [email protected] to provide a list of callback URLs that you would like to use.

Callback Response

After a user has completed a task we will redirect them to the callback URL and will also pass information about task and order status to the callback URL.

Success
When the user was able to successfully interact with the Task Manager

status: success
order: {
  "allTasksResolve": true,
  "externalId": <clientUserId>,
  "orderId": <orderId>,
  "orderState": <In Progress|Pended|Completed|Cancelled>
}

Error
In some rare cases when Task Manager is not able to display tasks we will send pass some error responses to the callback

No Tasks Available

status: error
error: No Tasks Available
message: It looks like there are no tasks for you at this time. Please check again in a few days.
order: {
  "allTasksResolve": true,
  "externalId": <clientUserId>,
  "orderId": <orderId>,
  "orderState": <In Progress|Pended|Completed|Cancelled>
}

Task List Error

status: error
error: Task List error
message: It looks like something broke down. Our engineers have been notified and will have things back up and running in no time.
order: {
  "allTasksResolve": true,
  "externalId": <clientUserId>,
  "orderId": <orderId>,
  "orderState": <In Progress|Pended|Completed|Cancelled>
}

consumerLink expired

status: error
error: Forbidden
message: The provided Token has expired

🚧

Note

If callback URL is not approved by Human API or is misconfigured, the user will see an error page instead.