Tasks

Retrieve All Tasks#

The tasks API allows customers using Constructor's ingestion service to request the status of asynchronous jobs, such as catalog uploads and user data requests made for compliance reasons.

The tasks endpoint is most commonly used to check on the status of files uploaded for ingestion to the FTP and catalog HTTP endpoints, to request ingestion jobs in progress, queued, succeeded and failed.

curl -X GET -H "Content-Type: application/json" \
-u"[your token]:" "https://ac.cnstrc.com/v1/tasks?key=[your API key]&page=[page number]&num_results_per_page=[number of tasks per page]"

HTTP Request#

GET https://ac.cnstrc.com/v1/tasks?key=[your API key]&page=[page number]&num_results_per_page=[number of tasks per page]

Response format#

{
"total_count": 1,
"tasks": [
{
"id": 0,
"type": "ingestion",
"status": "QUEUED",
"submission_time": "2020-04-24T15:06:27Z",
"last_update": null,
"filename": "somefile.csv"
}
],
"status_counts": {
"QUEUED": 1,
"DONE": 0,
"IN_PROGRESS": 0,
"FAILED": 0
}
}

Query Parameters#

ParameterRequired?Description
keyYesThe key of the index you'd like to to retrieve tasks for.
pageNoPage number you'd like to request. Defaults to 1.
num_results_per_pageNoNumber of tasks per page in paginated response. Default value is 20.

Retrieve By Specific Task ID#

curl -X GET -H "Content-Type: application/json" \
-u"[your token]:" "https://ac.cnstrc.com/v1/task/0?key=[your API key]"

HTTP Request#

GET https://ac.cnstrc.com/v1/task/[task_id]?key=[your API key]

Response format#

{
"id": 0,
"status": "QUEUED",
"submission_time": "2020-04-24T15:06:27Z",
"last_update": null,
"start_time": null",
}

Response fields#

ParameterDescription
idThe id of the task.
statusCurrent status of the task (QUEUED, DONE, FAILED, IN_PROGRESS).
submission_timeTime of task submission.
last_updateLast time the status of this task was updated. (May be null if the task has never been run before).
start_timeStarting time of the task. (May be null if the task has not been run yet).
typeThe type of the task. References the job that is done by the task. Possible values: ingestion, user_data_request
filenameOnly for type="ingestion". The name of the file uploaded to constructor.
protocolOnly for type="ingestion". Describes if the ingestion was created via FTP ("ftp"), API ("http") or other source (null).

URL Parameters#

ParameterDescription
task_idThe id of the task you would like to retrieve information about.

Query Parameters#

ParameterRequired?Description
keyYesThe index you'd like to to retrieve tasks for.

Task types#

  • ingestion - data uploading to Constructor via HTTP or FTP
  • user_data_request - CCPA requests