Throughput

API to be used by the clients to submit task completed info which is used to capture task attributes of completed unit of work across different workstreams.

Throughput API

post

API to be used by the clients to submit task completed info which is used to capture task attributes of completed unit of work across different workstreams.

Path parameters
workstream_idstringRequired

CloudFactory platform WorkStream ID

Header parameters
x-api-keystringRequired

API key of the associated workstream

Example: loAwlMCCxv4TlpLWR8a2e6
Body
worker_idstringRequired

Email address or any other identifier of the worker who completed the task

Example: [email protected]
task_idstringOptional

ID of task that was completed

Example: 032d6802-0efa-46de-a73c-6c24f094dfcf
task_urlstringOptional

URL of the completed task

Example: https://taskus.com/annotate/123412
task_countnumberOptional

The total number of tasks that were completed. The default is one, to signify that each API call represents a single task.

Example: 10
subtask_countnumberOptional

The total number of subtasks that were completed. The default is null.

Example: 10
use_case_idstringRequired

The ID of the Use Case to which the task belongs. It is validated against the WorkStream configuration

Example: 305ea07b-1d24-4f8f-8e1d-aae27cb07840
task_definition_idstringRequired

The ID of the Task Definition to which the task belongs. It is validated against the WorkStream configuration.

Example: 4ed59e6b-bf4b-4f33-a1dc-4015d63eef59
task_started_atstring · date-timeRequired

Timestamp (in ISO 8601 datetime format) for when the task was started.

Example: 2020-12-22T09:13:24.127Z
task_completed_atstring · date-timeRequired

Timestamp (in ISO 8601 datetime format) for when the task was completed.

Example: 2020-12-22T10:13:24.127Z
durationnumberOptional

The time taken to complete the task (in seconds). If this is not provided, then it is calculated automatically as 'task_completed_at' minus 'task_started_at'.

Example: 3600
task_created_atstring · date-timeOptional

The task created timestamp in ISO 8601 datetime format

Example: 2020-12-22T10:13:24.127Z
data_sourcestringOptional

This can be used to specify how the data was sourced. If it is provided, then the 'data_source' must be one of 'api', 'csv_manual' or 'csv_automated'.

Example: api
task_metadataobjectOptional

These are key-value pairs used to define the task.

Example: {"Person Label":"29","Date Label":"120","Organization Label":"132"}
dataset_idstringOptional

ID of the dataset which the task belongs to

Example: 6c24f094dfcf
asset_idstringOptional

ID of the parent asset which the task belongs to

Example: 6c24f094dfcf
unique_idstringOptional

Any unique identifier that if sent will be checked for uniqueness in the system for any given WorkStream, use case and task definition

Example: 032d6802-0efa-46de-a73c-6c24f094dfcf
replace_duplicatebooleanOptional

When true, it replaces the old values with the new ones. If false, it will simply ignore the duplicate API call

Example: true
Responses
202
Successful
application/json
post
POST /v1/workstreams/{workstream_id}/task_completed HTTP/1.1
Host: api.cloudfactory.app
x-api-key: loAwlMCCxv4TlpLWR8a2e6
Content-Type: application/json
Accept: */*
Content-Length: 750

{
  "worker_id": "[email protected]",
  "task_id": "032d6802-0efa-46de-a73c-6c24f094dfcf",
  "task_url": "https://taskus.com/annotate/123412",
  "task_count": 10,
  "subtask_count": 10,
  "use_case_id": "305ea07b-1d24-4f8f-8e1d-aae27cb07840",
  "task_definition_id": "4ed59e6b-bf4b-4f33-a1dc-4015d63eef59",
  "task_started_at": "2020-12-22T09:13:24.127Z",
  "task_completed_at": "2020-12-22T10:13:24.127Z",
  "duration": 3600,
  "task_created_at": "2020-12-22T10:13:24.127Z",
  "task_measurements": {
    "attribute_1_count": 340,
    "attribute_1_label": "Words"
  },
  "data_source": "api",
  "task_metadata": {
    "Person Label": "29",
    "Date Label": "120",
    "Organization Label": "132"
  },
  "dataset_id": "6c24f094dfcf",
  "asset_id": "6c24f094dfcf",
  "unique_id": "032d6802-0efa-46de-a73c-6c24f094dfcf",
  "replace_duplicate": true
}
{
  "message": "Data successfully received."
}

Last updated

Was this helpful?