Task
Tasks are used as status monitors of asynchronous operations.
Tasks with succeeded status can redirect to the object created as a result of them. If no_redirect=true is passed as a query parameter, endpoint won't redirect to an object created, but will return information about the task itself instead.
Task Types
Currently supported task types:
documents_download- Used for monitoring document download operations.upload_created- Used for monitoring upload creation operations.email_imported- Used for monitoring email import operations.
Task Content
The content field contains detailed information related to tasks, which varies by task type:
Documents Download Task Content
file_name(string) - File name of the archive to be downloaded specified when creating a download.
Documents Upload Task Content
upload(url) - URL of the object representing the upload.
Task
Task object ID.
Task object URL.
Timestamp of a guaranteed availability of the task object. Expired tasks are being deleted periodically.
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.
Detailed information related to tasks. Content structure varies by task type:
- For
documents_download: containsfile_name(string) - File name of the archive to be downloaded. - For
upload_created: containsupload(url) - URL of the object representing the upload.
Error code.
Succeeded status resulting redirect URL.
Retrieve task
GET api / v1 / tasks / {taskID}
Get a task object.
Response Behavior:
- If the task has status
runningorfailed, the endpoint returns status200with the task object. - If the task has status
succeededandno_redirectparameter is not set or isfalse, the endpoint redirects with status303to the newly created object (URL provided inresult_url). - If the task has status
succeededandno_redirect=trueis passed, the endpoint returns the task object with status200.
curl -X GET "https://example.rossum.app/api/v1/tasks/0"{
"id": 24,
"url": "https://example.rossum.app/api/v1/tasks/24",
"type": "documents_download",
"status": "running",
"expires_at": "2021-09-11T09:59:00.000000Z",
"detail": null,
"content": {
"file_name": "my-archive.zip"
}
}{
"detail": "Bad Request.",
"code": "bad_request"
}{
"detail": "Invalid token.",
"code": "authentication_failed"
}{
"detail": "Access to the requested resource is forbidden.",
"code": "access_forbidden"
}{
"detail": "Not found.",
"code": "not_found"
}{
"detail": "Conflict.",
"code": "conflict_status"
}{
"detail": "Request was rate limited.",
"code": "rate_limited",
"url": "https://rossum.app/api/docs/openapi/guides/overview/#rate-limiting"
}{
"detail": "Server error.",
"code": "error"
}{
"detail": "Bad Gateway.",
"code": "bad_gateway"
}{
"detail": "Service Unavailable.",
"code": "service_unavailable"
}{
"detail": "Gateway timeout.",
"code": "gateway_timeout"
}Response
OK - Returns the task object. This response is returned when:
- Task status is
runningorfailed - Task status is
succeededandno_redirect=trueparameter was passed
Task object ID.
Task object URL.
Timestamp of a guaranteed availability of the task object. Expired tasks are being deleted periodically.
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.
Detailed information related to tasks. Content structure varies by task type:
- For
documents_download: containsfile_name(string) - File name of the archive to be downloaded. - For
upload_created: containsupload(url) - URL of the object representing the upload.
Error code.
Succeeded status resulting redirect URL.
See Other - Redirects to the newly created object when task status is succeeded and no_redirect parameter is not set.
The URL of the created object is provided in the Location header and matches the result_url field from the task object.
No response body.
Invalid input data.
Detail of the error
Code of the error
The username/password is invalid or token is invalid (e.g. expired).
Detail of the error
Code of the error
Insufficient permission, missing authentication, invalid CSRF token and similar issue.
Detail of the error
Code of the error
The specified resource was not found.
Detail of the error
Code of the error
Conflict
Detail of the error
Code of the error
Request rate is too high, wait before sending more requests. See Rate Limiting for more details.
Detail of the error
Code of the error
Link to the rate limiting documentation
Server failure while processing the request.
Detail of the error
Code of the error
Invalid response from the upstream server.
Detail of the error
Code of the error
We're temporarily offline for maintenance. Please try again later.
Detail of the error
Code of the error
Upstream server could not complete the request in time.
Detail of the error
Code of the error