REST API: Download File

Last Updated: July 27, 2018

Description

Download a file in raw binary format.

Resource Information

HTTP Method GET
Endpoint https://rest.tsheets.com/api/v1/files/raw
Authentication Token header required. See authentication section
Request format Everything is handled through the request uri on a GET.
Response format The raw bytes are returned, and the Content-Type header is set to a binary media type of application/octet-stream

Available Filters

id:
Required
Integer. File id.

Examples

The following request returns a .jpg object.

## REQUEST
curl -H "Authorization: Bearer <Access-Token>" -i "https://rest.tsheets.com/api/v1/files/raw?id=123828"

## RESPONSE
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: 95
Content-Disposition: attachment; filename="invisible_minion.jpg"
Cache-Control: max-age=86400

[95 bytes of object data]