New in MC | Cloud UX 2022.3
Overview
The aa:multi-value-attribute-range resource represents a range of rows of a multi-value attribute of an asset.
Properties
Link Relations
prev, next, first, range |
Link relations for paging. See paging for details. |
---|---|
Link to the asset that contains the attribute. |
|
Update the rows of the multi-value attribute via JSON Patch. The row numbers used in the JSON Patch operations always correspond to the full list of rows. For example, if you request a range with offset=5, the aa:multi-value-attribute-range resource will skip the first 5 rows (row numbers 0 to 4) and the response starts with the row with row number 5. To update that row with aa:update-multi-value-attribute you must use a path that starts with "/rows/5". |
Rows
The property rows contains a subset of the rows of the multi-value attribute, in the order of the row index. The range is defined by the query parameters offset and limit. If offset is not given, the rows are returned beginning with the first row (offset=0). If limit is not given, the returned maximum number of rows is determined by the CTC service.
Each row is represented by a JSON object with properties for the attributes of that row:
{
"paging": {
"offset": 0, // requested offset
"limit": 10, // requested maximum number of entries to return
"elements": 2, // actual number of returned elements
"totalElements": 2 // actual total number of elements (if requested with ?insist=totalElements)
},
"rows": [
{
// attributes of first row in range
},
{
// attributes of second row in range
},
...
]
}
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-range resource for attribute CONTRIBUTIONS with 5 rows when requested with offset=3&limit=2:
{
"name": "CONTRIBUTIONS",
"paging": {
"offset": 3,
"limit": 2,
"elements": 2,
"totalElements": 5
},
"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/…"
},
"prev": {
"href": "https://host/…"
},
"next": {
"href": "https://host/…"
},
"first": {
"href": "https://host/…"
},
"aa:asset": {
"href": "https://host/…"
},
"aa:update-multi-value-attribute": {
"href": "https://host/…"
}
}
}