Skip to Content
Docs
Documents

Retrieve document contents

GET/documents/{id}/contents

Retrieves the binary contents of a document. The response Content-Type is the content type of the uploaded file. Contents are only available once the document status is active; before that the request returns 404.

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.

Path parameters

idstringRequired

Unique identifier for the document.

Returns

Returns the document contents, with the Content-Type of the uploaded file.

Errors

400
Invalid request parameters.
401
The API key or access token is missing, unknown or no longer works (invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).
403
The request was refused: the API key may not make it (for example resource_not_allowed, key_disabled, network_not_allowed, pci_required or merchant_required), or this resource isn't enabled for your account (permission_denied). code says why.
404
Document not found, or its status is not yet active.
500
Internal server error.
503
Service unavailable. Retry after the number of seconds in Retry-After, or after a few seconds when there's none.
Was this page helpful?