Link relation aa:set-thumb-command

New in MC | Cloud UX 2020.4

Overview

Replace the thumbnail of an asset. Depending on the given Content-Type header, the link rel accepts either an aa:thumb resource with a download link for the new image, or a binary image as payload.

The link rel starts a long-running command.

HTTP method

POST

URI template variables

-

Query parameters

commandid

ID to use for the command

Request body

The body depends on the value of the Content-Type HTTP header.

If the Content-Type header is set to "application/json" or "application/hal+json", the method accepts an aa:thumb resource with a download link for the new image like this:

{
	"thumbnail":"http://host/..."
}

You can also use null as value to remove the thumbnail for an asset:

{
	"thumbnail":"http://host/..."
}

If the Content-Type header is set to a supported image type like "image/jpeg" or "image/png", the method accepts a binary image as body. The size of a binary image is currently limited to 1 MB.

HTTP response

200 OK

403 Forbidden

The caller has no read permission for the asset.

404 Not Found

The asset doesn’t exist or the service or an intermediate resource is not available.

Response body

A command:command resource with the current information about the long-running command.

The client should use polling to learn about the progress and final lifecycle of the command.

If the final lifecycle is "finished", the command will have an embedded aa:thumb resource with the link to the new thumbnail image.

Available in

Examples

Successful command

An example of a successfully finished aa:set-thumb-command command with an embedded aa:thumb resource with a link to the updated thumbnail.

Example: A successfully finished command
 
{
  "command": {
    "type": "aa:set-thumb-command",
    "id": "c296fcd5-b0a8-4750-b80b-1d06c5a2ca8a",
    "lifecycle": "finished",
    "state": {
      "text": "Thumbnail changed successfully",
      "code": "CTMS/THUMB_CHANGED"
    },
    "progress": 100,
    "serviceName": "MAMAssetsCTC_1",
    "serviceInstance": "MAMAssetsCTC_1",
    "serviceVersion": "7.4.0.102",
    "created": "2020-01-27T13:21:53.9138053+01:00",
    "modified": "2020-01-27T13:21:54.6448607+01:00",
    "finished": "2020-01-27T13:21:54.6448607+01:00"
  },
  "version": "1.0",
  "_links": {
    "curies": [
      {
        "href": "https://developer.avid.com/ctms/api/command/linkrels/{rel}.html",
        "name": "command",
        "templated": true
      }
    ],
    "self": {
      "href": "https://host/…​"
    },
    "command:cancel": {
      "href": "https://host/…​"
    },
    "aa:thumb": {
      "href": "https://host/…​"
    }
  },
  "_embedded": {
    "aa:thumb": {
      "thumbnail": "https://host/…​",
      "_links": {
        "self": {
          "href": "https://host/…​"
        }
      }
    }
  }
}
 

Failed command

An example of a failed command with error information:

Example: A failed command
 
{
  "command": {
    "type": "aa:set-thumb",
    "id": "e9094d1d-5a28-46cd-91ac-0098076dd9d1",
    "lifecycle": "error",
    "error": {
      "text": "Failed to download image",
      "code": "CTMS/INTERNAL_SERVER_ERROR",
      "httpCode": 500,
      "cause": "runtimeError"
    },
    "serviceName": "MAMAssetsCTC_1",
    "serviceInstance": "MAMAssetsCTC_1",
    "serviceVersion": "7.4.0.102",
    "created": "2020-01-27T15:07:37.1875506+01:00",
    "modified": "2020-01-27T15:07:37.6025464+01:00",
    "finished": "2020-01-27T15:07:37.6025464+01:00"
  },
  "version": "1.0",
  "_links": {
    "curies": [
      {
        "href": "https://developer.avid.com/ctms/api/command/linkrels/{rel}.html",
        "name": "command",
        "templated": true
      }
    ],
    "self": {
      "href": "https://host/…​"
    },
    "command:cancel": {
      "href": "https://host/…​"
    }
  }
}