Skip to content

Download assets

Request

An AssetDownloadBatchJob should be created when you want to download and optionally transform multiple AssetFile resources.

You can optionally request that a zip is created of all the transformed files.

The transformationDescription in the request can be one of two types, CUSTOM or PRESET.

A CUSTOM transformationDescription is a list of candidateTransformations which are evaluated in turn against each AssetFile specified in the request. If the AssetFile meets the candidateTransformation.criteria then the candidateTransformation.transformation is applied. Otherwise, the next candiate is considered. The candidateTransformation.transformation is a series of operations to apply to the AssetFile in order (e.g. resize to 200 by 100 and then covert to JPG). An empty list of operations indicates the file should be left untransformed.

Putting this all together this allows you to describe a transformations such as:

  • Resized any image file, otherwise leave the file untransformed
  • Convert any image that supports transparency to PNG otherwise convert to JPG

A PRESET transformationDescription is similar to a CUSTOM transformation except the transformationDescription has been predefined. These presets are currently only configurable via the Dash frontend, but can be found via a PresetTransformationSearch.

Security
bearerToken
Bodyapplication/jsonrequired
itemsArray of objectsrequired
transformationDescriptionanyrequired
zipbooleanrequired

Whether to combine all the output files into a zip

Example:true
curl -i -X POST \
  https://api-v2.dash.app/asset-download-batch-jobs \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "items": [
      {
        "batchItemId": "download-1",
        "assetId": "2b746f61-d36d-4627-a547-936f6f20594b"
      },
      {
        "batchItemId": "download-2",
        "assetId": "23cfaab7-c9f3-4b28-ac21-7b5b18f2519a"
      },
      {
        "batchItemId": "download-3",
        "assetId": "1ef8108f-6c94-4112-9736-abd147a7a940"
      }
    ],
    "transformationDescription": {
      "type": "CUSTOM",
      "candidateTransformations": [
        {
          "criteria": [
            {
              "type": "MATCHES_MEDIA_TYPES",
              "mediaTypes": [
                {
                  "type": "*",
                  "subType": "*"
                }
              ]
            }
          ],
          "transformation": [
            {
              "type": "RESIZE",
              "width": 100,
              "height": 200
            },
            {
              "type": "CONVERT",
              "mediaType": {
                "type": "image",
                "subType": "jpeg"
              }
            }
          ]
        }
      ]
    },
    "zip": true
  }'

Responses

Success

Bodyapplication/json
idstringrequired

Unique identifier of the job that has been created

Example:"be161977-d44e-4888-af3c-66522e223963"
accountIdstringrequired

The ID of the account the job is happening in

Example:"cfb665ca-ce35-4418-b9d5-70ee815db4bd"
creatorIdstringrequired

The ID of the User who created the job

Example:"google-oauth2|110955770826801837334"
typestringrequired

The job type

Value:"IN_PROGRESS"
Discriminator
progressobjectrequired
statusstringrequired
Enum:"PENDING""STARTING""STARTED""STOPPING"
Response
{ "id": "be161977-d44e-4888-af3c-66522e223963", "accountId": "cfb665ca-ce35-4418-b9d5-70ee815db4bd", "creatorId": "google-oauth2|110955770826801837334", "type": "IN_PROGRESS", "status": "PENDING", "progress": { "steps": [] } }