Documents Download
Set of endpoints enabling download of multiple documents at once. The workflow of such action is as follows:
- Create a download object via POST on /documents/downloads. The response of the call will contain a task URL.
- Call GET on the task URL. Watch the task
statusto see when the task is ready.result_urlof a successful task will contain URL to the download object. - Either call GET on the download object to get metadata about the object or call GET on the download object's content endpoint to download the archive directly.
A download object contains information about a downloadable archive in a .zip format.
Documents download
ID of the download object
URL of the download object
Name of the archive to be downloaded.
Timestamp of a guaranteed availability of the download object and its content. Set to the archive creation time plus 2 hours. Expired downloads are being deleted periodically.
Link to the download's raw content. May be null if there is no archive associated yet.
Create download
POST api / v1 / documents / downloads
Create a new download object.
curl -X POST "https://example.rossum.app/api/v1/documents/downloads" \ -H "Content-Type: application/json" \ -d '{ "documents": [ "https://example.rossum.app/api/v1/documents/123000", "https://example.rossum.app/api/v1/documents/123001" ] }'{
"url": "https://example.rossum.app/api/v1/tasks/1"
}{
"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": "Payload Too Large.",
"code": "payload_too_large"
}{
"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"
}Request Body
application/json
Comma-separated list of document URLs to be included in the resulting downloadable archive. Max. 500 documents.
The filename of the resulting archive. Must include a .zip extension.
"documents.zip"One of document and source_document. The source_document means that for each of the documents the most distant non-empty parent document is put into the download.
"document"Use application/zip to bundle the download contents. The zip value of false is only applicable for single document downloads where the file_name if omitted in the request is taken from the document being downloaded.
trueResponse
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
Payload too large (especially for files uploaded).
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
Retrieve download
GET api / v1 / documents / downloads / {documentsDownloadID}
Get a download object.
curl -X GET "https://example.rossum.app/api/v1/documents/downloads/0"{
"id": 105,
"url": "https://example.rossum.app/api/v1/documents/456700",
"file_name": "test_invoice_1.pdf",
"expires_at": "2023-09-13T23:04:00.933658Z",
"content": "https://example.rossum.app/api/v1/documents/downloads/105/content"
}{
"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
ID of the download object
URL of the download object
Name of the archive to be downloaded.
Timestamp of a guaranteed availability of the download object and its content. Set to the archive creation time plus 2 hours. Expired downloads are being deleted periodically.
Link to the download's raw content. May be null if there is no archive associated yet.
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
Retrieve download content
GET api / v1 / documents / downloads / {documentsDownloadID} / content
Get archive with original document files.
curl -X GET "https://example.rossum.app/api/v1/documents/downloads/0/content""string"{
"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
responsestring (binary)Archive with original document files
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