Download preview
GET
/media/{id}/download/{size}
const url = 'https://api.colourbox.com/media/1/download/example?on_behalf_of=Arne&project_id=753';const options = {method: 'GET', headers: {Authorization: 'CBX-SIMPLE-TOKEN Token=<token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.colourbox.com/media/1/download/example?on_behalf_of=Arne&project_id=753' \ --header 'Authorization: CBX-SIMPLE-TOKEN Token=<token>'Download a preview of media with given size.
Colourbox downloads can be accssed via this endpoint if you have access.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
size
required
string
Size can be one of the following values:
| Name | Size |
|---|---|
| 110px | 110 px on the longest side |
| 200px | 200 px on the longest side |
| 320px | 320 px on the longest side |
| 480px or preview | 480 px on the longest side |
| 800px | 800 px on the longest side |
| 1200px | 1200 px on the longest side |
| 1600px | 1600 px on the longest side |
Note: For videos only preview applies. This will give you an mp4 video with width 1280 and height
to preserve aspect ratio. If this aspect of your video is 16:9, this can be considered 720p.
Query Parameters
Section titled “Query Parameters”download_info
string
A blob of JSON which describes the download
Example
{ "on_behalf_of": "Arne", "project_id": 753}filename
string
Set the filename of the file being downloaded. If not set the filename will be the original filename or foldername
user
string
Set the user ID the download should be attributed to. This is a requirement if downloading Colourbox downloads and API key authentication is used.
Responses
Section titled “Responses”Media in scaled down version