Skip to content

Get preview download location

GET
/media/{id}/download_location/{size}
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.

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.

download_info
string

A blob of JSON which describes the download

Example

{
"on_behalf_of": "Arne",
"project_id": 753
}
share_hash
string

The share hash of a share link containing the media. Not needed if you have download access to the media.

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.

Json description of method for fetching download

Media typeapplication/json
object
method

Will always be GET for this endpoint

string
url

URL media can be downloaded from. Valid for at least 5 minutes (15 when it points straight to storage); use it right away.

string

Example

{
"method": "GET"
}