Task

Retrieve task

Get a task object.

Response Behavior:

  • If the task has status running or failed, the endpoint returns status 200 with the task object.
  • If the task has status succeeded and no_redirect parameter is not set or is false, the endpoint redirects with status 303 to the newly created object (URL provided in result_url).
  • If the task has status succeeded and no_redirect=true is passed, the endpoint returns the task object with status 200.
get/api/v1/tasks/{taskID}

Path parameters

taskIDinteger required

Task ID.

Query parameters

no_redirectboolean

If true, prevents redirect to the created object and returns the task object instead.

Response

OK - Returns the task object. This response is returned when:

  • Task status is running or failed
  • Task status is succeeded and no_redirect=true parameter was passed
idinteger required

Task object ID.

urlstring uri required

Task object URL.

type'documents_download' | 'upload_created' | 'email_imported' required
status'running' | 'succeeded' | 'failed' required
expires_atstring date-time required

Timestamp of a guaranteed availability of the task object. Expired tasks are being deleted periodically.

detailstring nullable required

Detailed message on the status of the task. For failed tasks, error id is included in the message and can be used in communication with Rossum support for further investigation.

contentobject required

Detailed information related to tasks. Content structure varies by task type:

  • For documents_download: contains file_name (string) - File name of the archive to be downloaded.
  • For upload_created: contains upload (url) - URL of the object representing the upload.
codestring nullable required

Error code.

result_urlstring uri nullable required

Succeeded status resulting redirect URL.

Example response

{
  "id": 1,
  "url": "https://example.rossum.app/api/v1/tasks/1",
  "type": "documents_download",
  "status": "succeeded",
  "expires_at": "2021-09-11T09:59:00.000000Z",
  "content": {
    "file_name": "my-archive.zip"
  },
  "result_url": "https://example.rossum.app/api/v1/documents/456700"
}

Changes