Files

A file resource can represent all kinds of files like shipment labels, available in different file formats.

File

API specification

Attribute Description
document_type Category the file belongs to, for example label or invoice.
formats List of Format objects holding the extension and mime type in which the file is available.

Format

If you request a file using the default Accept header application/vnd.api+json, you will get a list of the supported formats of that file. This list can contain the following mime types:

  • application/pdf
  • image/png

Retrieve a file in a specific format

GET /files/{file_id}

Use one of the available formats in the Accept header to retrieve the actual file as binary data. For example:

GET /files/a9e3852c-b8b2-4066-a32a-651ea661ba30 HTTP/1.1
Accept: application/pdf

The response will be of the same mime type and contain the raw file data.

HTTP/1.1 200 OK
Content-Type: application/pdf

%PDF-1.4 [...] %%EOF
15-08-2018