# Download ## Request Batch **post** `/assets/download` Request a link to batch download assets (batch limited to 1000 assets) ### Body Parameters - `options: object { fileNameTemplate, flat }` - `fileNameTemplate: string` A file naming convention as a string with the following available parameters: (seed used to generate the asset) (index of the asset in the inference) (prompt of the inference) (prompt of the generator) Example: "---" - `flat: optional boolean` Flag to prevent grouping assets in directories and store them flat - `query: object { assetIds, inferenceIds, modelIds }` - `assetIds: array of string` Every individual assets specified will be included in the archive - `inferenceIds: array of string` All assets issued from the provided inference ids will be included in the archive - `modelIds: array of string` All assets issued from the provided model ids will be included in the archive ### Returns - `jobId: string` The job id associated with the download request ### Example ```http curl https://api.cloud.scenario.com/v1/assets/download \ -H 'Content-Type: application/json' \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \ -d '{ "options": { "fileNameTemplate": "fileNameTemplate" }, "query": { "assetIds": [ "string" ], "inferenceIds": [ "string" ], "modelIds": [ "string" ] } }' ``` #### Response ```json { "jobId": "jobId" } ``` ## Get Status **get** `/assets/download/{jobId}` Retrieve the status and the url of a batch download assets request ### Path Parameters - `jobId: string` ### Returns - `jobId: string` The job id associated with the download request - `jobStatus: string` The current job status - `downloadUrl: optional string` The download url ### Example ```http curl https://api.cloud.scenario.com/v1/assets/download/$JOB_ID \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" ``` #### Response ```json { "jobId": "jobId", "jobStatus": "jobStatus", "downloadUrl": "downloadUrl" } ``` ## Request **post** `/assets/{assetId}/download` Request a link to download the given `assetId` in the given `targetFormat` ### Path Parameters - `assetId: string` ### Body Parameters - `targetFormat: optional "gif" or "heif" or "jpeg" or 10 more` The format to download the asset in - `"gif"` - `"heif"` - `"jpeg"` - `"jpg"` - `"png"` - `"svg"` - `"webp"` - `"avif"` - `"tif"` - `"tiff"` - `"glb"` - `"fbx"` - `"obj"` ### Returns - `url: string` The signed URL to download the asset in the given format ### Example ```http curl https://api.cloud.scenario.com/v1/assets/$ASSET_ID/download \ -H 'Content-Type: application/json' \ -u "$SCENARIO_SDK_API_KEY:SCENARIO_SDK_API_SECRET" \ -d '{}' ``` #### Response ```json { "url": "url" } ``` ## Domain Types ### Download Request Batch Response - `DownloadRequestBatchResponse object { jobId }` - `jobId: string` The job id associated with the download request ### Download Get Status Response - `DownloadGetStatusResponse object { jobId, jobStatus, downloadUrl }` - `jobId: string` The job id associated with the download request - `jobStatus: string` The current job status - `downloadUrl: optional string` The download url ### Download Request Response - `DownloadRequestResponse object { url }` - `url: string` The signed URL to download the asset in the given format