Resource aa:multi-value-attribute

New in MC | Cloud UX 2021.3

Overview

The aa:multi-value-attribute resource represents the rows of a multi-value attribute of an asset.

Properties

The aa:multi-value-attribute resource has the following properties:

name

Name of the multi-value attribute.

rows

Array of rows in the order of the row index. See rows for details.

aa:asset

Link to the asset that contains the attribute.

aa:update-multi-value-attribute

Update the rows of the multi-value attribute via JSON Patch.

Rows

The property rows contains an array of rows in the order of the row index. Each row is represented by a JSON object with properties for the attributes of that row:

{
  "rows": [
    {
       // attributes of first row
    },
    {
       // attributes of second row
    },
    ...
  ]
}

The format is the same for multi-value compound and multi-value non-compound attributes, only that multi-value non-compound attrributes are treated like multi-value compound attributes with one sub attribute.

Multi-value compound

For multi-value compound attributes, each row is a JSON object with a JSON property for every sub attribute that has a non-empty and non-null value in the row:

  • The name of the property is the name of the sub attribute.

  • The value of the property has the same JSON structure as an attribute in the attributes property of aa:attributes, only that the name is missing.

Example for a string attribute REAL_NAME:

    "REAL_NAME": {
      "value": "Gary Cooper"
    }

Example for a taxonomy attribute ROLE:

    "ROLE": {
      "type": "thesaurus",
      "value": "488",
      "value-labels": {
        "en": "Actor"
      },
      "taxonomyid": "TH_EBU_ROLE_CODE"
    }

Example for a multi-value compound CONTRIBUTIONS with two rows:

REAL_NAME

ROLE (thesaurus)

ROLE_NAME

Gary Cooper

488 "Actor"

Marshal Will Kane

Grace Kelly

488 "Actor"

Amy Fowler Kane

The sub attributes REAL_NAME and ROLE_NAME are text attributes, ROLE is a thesaurus attribute (with 488 as thesaurus ID and "Actor" as English label).

Then, the property rows contains the following JSON, when queried with ?lang=en:

"rows": [
  {
    "REAL_NAME": {
      "value": "Gary Cooper"
    },
    "ROLE": {
      "type": "thesaurus",
      "value": "488",
      "value-labels": {
        "en": "Actor"
      },
      "taxonomyid": "TH_EBU_ROLE_CODE"
    },
    "ROLE_NAME": {
      "value": "Marshal Will Kane"
    }
  },
  {
    "REAL_NAME": {
      "value": "Grace Kelly"
    },
    "ROLE": {
      "type": "thesaurus",
      "value": "488",
      "value-labels": {
        "en": "Actor"
      },
      "taxonomyid": "TH_EBU_ROLE_CODE"
    },
    "ROLE_NAME": {
      "value": "Amy Fowler Kane"
    }
  }
]

Multi-value non-compound

Multi-value non-compound attributes are treated like multi-value compound attributes having one sub attribute with the same name as the multi-value non-compound attribute.

Example for a multi-value text attribute ALT_TITLES:

ALT_TITLES

Zwölf Uhr mittags

Le train sifflera trois fois

Solo ante el peligro

Then, the property rows contains the following JSON:

"rows": [
  {
    "ALT_TITLES": {
      "value": "Zwölf Uhr mittags"
    }
  },
  {
    "ALT_TITLES": {
      "value": "Le train sifflera trois fois"
    }
  },
  {
    "ALT_TITLES": {
      "value": "Solo ante el peligro"
    }
  }
]

The multi-value text attribute ALT_TITLES is treated like a multi-value compound attribute ALT_TITLES with one sub attribute ALT_TITLES. Apart from that, the format is the same as in the attributes property of aa:attributes.

Relation to "index" in aa:attributes

If you compare the JSON format used here with the JSON format used for multi-value attributes in the aa:attributes resource, you’ll notice that the format in aa:attributes has an index property for each row. The index property directly reflects an order index value stored in MC|AM for each row. This order index is tricky to handle, because the values are not necessarily consecutive.

The format used here simplifies usage by hiding the technical details of this order index value. Instead, the rows are returned as a simple array that contains the rows in the correct order.

Full example

Example: aa:multi-value-attribute resource for attribute CONTRIBUTIONS:
 
{
  "name": "CONTRIBUTIONS",
  "rows": [
    {
      "ROLE": {
        "type": "thesaurus",
        "value": "488",
        "value-labels": {
          "en": "Actor"
        },
        "taxonomyid": "TH_EBU_ROLE_CODE"
      },
      "ROLE_NAME": {
        "value": "Marshal Will Kane"
      },
      "REAL_NAME": {
        "value": "Gary Cooper"
      }
    },
    {
      "ROLE": {
        "type": "thesaurus",
        "value": "488",
        "value-labels": {
          "en": "Actor"
        },
        "taxonomyid": "TH_EBU_ROLE_CODE"
      },
      "ROLE_NAME": {
        "value": "Amy Fowler Kane"
      },
      "REAL_NAME": {
        "value": "Grace Kelly"
      }
    }
  ],
  "_links": {
    "curies": [
      {
        "href": "http://developer.avid.com/ctms/api/aa/linkrels/{rel}.html",
        "name": "aa",
        "templated": true
      }
    ],
    "self": {
      "href": "https://host/…"
    },
    "aa:asset": {
      "href": "https://host/…"
    },
    "aa:update-multi-value-attribute": {
      "href": "https://host/…"
    }
  }
}