- 17 Jan 2024
- Print
Upload a thumbnail
- Updated on 17 Jan 2024
- Print
Upload a thumbnail using an existing upload URL
If an upload URL has already been generated for your thumbnail, you can use it instead for uploading the thumbnail.
Get the upload URL from the API's Get Thumbnail Upload URL endpoint.
The upload URL will contain a token that is valid for 4 hours.
In the curl request, specify the upload URL, the token, and the mime type of the image.
The file parameter should be set to the filename of the local thumbnail image file, with a leading @/.
If the upload is successful, the response will be a 204 code.
If the upload fails, the response will be an error code, such as 1101 - Upload denied because the booked storage capacity limit is reached.
Here is an example curl request:
curl -X POST -F "file=@/thumbnail.jpg" "https://file-1-b.video-cdn.net/FQMx5EcAGqS-789vU7s6QY/78463.UPLOAD_Bzg_-8GaCUeRDYhaLd3eCf.jpeg/still?mime-type=image%2Fjpeg&token=abc123"
URL | |
---|---|
UPLOAD_URL | An example upload URL is shown above. This is returned from the API's Get Thumbnail URL endpoint. |
Parameters | |
token | The token is returned along with the upload URL and is valid for 4 hours (see warning above). |
mime-type | The upload URL also contains the mime type of the image. |
Form Data | |
file=@/<FILENAME> | Indicate the filename (and path if necessary) of the local thumbnail image file to upload. Ensure that you add "@/" in front of the filename. |
Here are some additional tips for optimizing the upload:
Use a lossless compression tool to reduce the size of the thumbnail image without sacrificing quality.
Resize the thumbnail image to the desired dimensions.
Avoid using transparent backgrounds, as this can increase the file size.