Get preview download location
const url = 'https://api.colourbox.com/media/1/download_location/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_location/example?on_behalf_of=Arne&project_id=753' \ --header 'Authorization: CBX-SIMPLE-TOKEN Token=<token>'Get the download location for a preview of the media in the given size.
Authenticate with the Authorization header, or pass share_hash. The Authorization URL parameter is not
accepted here; use /media/:id/download/:size
for embeddable URLs.
Authorizations
Section titled “Authorizations”- simple_token
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”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”A blob of JSON which describes the download
Example
{ "on_behalf_of": "Arne", "project_id": 753}The share hash of a share link containing the media. Not needed if you have download access to the media.
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”Json description of method for fetching download
object
Will always be GET for this endpoint
URL media can be downloaded from. Valid for at least 5 minutes (15 when it points straight to storage); use it right away.
Example
{ "method": "GET"}