Skip to content
Get started

Request

client.assets.download.request(stringassetID, DownloadRequestParams { projectId, targetFormat } params, RequestOptionsoptions?): DownloadRequestResponse { url, mimeType }
POST/assets/{assetId}/download

Request a link to download the given assetId in the given targetFormat

ParametersExpand Collapse
assetID: string
params: DownloadRequestParams { projectId, targetFormat }
projectId?: string

Query param: The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

targetFormat?: "gif" | "heif" | "jpeg" | 12 more

Body param: The format to download the asset in. If omitted, the original file is returned. Audio and video assets only accept their stored format.

One of the following:
"gif"
"heif"
"jpeg"
"jpg"
"png"
"svg"
"webp"
"avif"
"tif"
"tiff"
"glb"
"fbx"
"obj"
"mp3"
"mp4"
ReturnsExpand Collapse
DownloadRequestResponse { url, mimeType }
url: string

The signed URL to download the asset in the requested format, or its original file when targetFormat is omitted

mimeType?: string

Mime type of the file served at url

Request

import Scenario from '@scenario-labs/sdk';

const client = new Scenario({
  apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
  apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});

const response = await client.assets.download.request('assetId');

console.log(response.url);
{
  "url": "url",
  "mimeType": "mimeType"
}
Returns Examples
{
  "url": "url",
  "mimeType": "mimeType"
}