Scale
Callbacks
On your tasks, you can optionally supply a
Additionally, in order to simplify testing and add support for email automation pipelines, you may provide an email address as the
You should respond to the POST request with a 2xx status code. If we do not receive a 2xx status code, we will continue to retry up to 20 times over the course of the next 24 hours.
If we receive a 2xx status code, the task will be populated with a
Example callback body
{
"task": {
"task_id": "576c41bf13e36b0600b02b34",
"completed_at": "2016-06-23T21:54:44.904Z",
"response": {
"category": "red"
},
"created_at": "2016-06-23T20:08:31.573Z",
"callback_url": "http://www.example.com/callback",
"type": "categorization",
"status": "completed",
"instruction": "Is this object red or blue?",
"params": {
"attachment_type": "text",
"attachment": "tomato",
"categories": [
"red",
"blue"
]
},
"metadata": {}
},
"response": {
"category": "red"
},
"task_id": "576c41bf13e36b0600b02b34"
}
Getting Started
If you're just testing and want to try a few requests, the easiest way to get started is to use a RequestBin and send requests using the provided URL as the
We've also found Pipedream to be an easy-to-use platform to receive webhooks, view logs, take other actions.
Authentication
If you'd like to authenticate our callbacks, we set a
Events that trigger a Callback
Callbacks are sent for the following events:
Error on Task Creation (see Errors for more details)
Task Completion
Audit Status Changes (Approved, Rejected, Fixed)
Tasks that are "Recalled" by Scale, meaning an operation on Scale's side converts
completedtasks back topendingso they can have follow-on work done on them. This conversion is coordinated and communicated with you as the customer if it needs to happen.
POST Data
Property | Type | Description |
---|---|---|
task_id | string | The |
status | string | The status of the task when it was completed. Normally |
response | object | The response object of the completed request. It is identical to task.response |
task | object | The full Task Object for reference and convenience. |
Re-sending a Callback
This endpoint re-sends a callback for a completed or errored task to the
Request
INSTALLATION
$ python -m pip install requests
---
import requests
url = "https://api.scale.com/v1/task/taskId/send-callback"
headers = {"accept": "application/json"}
response = requests.post(url, headers=headers)
print(response.text)