DC 5.8 Getting asset metadata
Getting metadata is probably one of the most core features of the Digizuite. All metadata is requested through the same API. Metadata for multiple assets can be requested at the same time. This API is mainly intended to either do full metadata synchronization or to build metadata editors. If you just need some additional metadata to render your assets, it is recommended to use the metaFieldItemGuids
parameter on the Get assets API.
URL: /digizuitecore/legacyservice/api/metadata/editor
Method: POST
Auth required: YES
Request properties
Name | Example | Description |
---|---|---|
|
| The item ids of the assets to request metadata for. Multiple ids can be passed. |
|
| If you only want metadata for certain metafield label ids, then use this parameter. |
|
| If you only want certain metafield, then you can pass the item ids of the metafields with this parameter. |
|
| If you only want certain metafield, then you can pass the item guids of the metafields with this parameter. |
|
| If you only want fields in a specific metadata group, then the group ids can be passed here. |
|
| If |
|
| If multiple languages are enabled on the system, then this can be used to restrict what languages values are returned in. If empty or not specified, then all enabled languages will be returned. |
Example request:
POST https://<my-dam>/digizuitecore/legacyservice/api/metadata/editor
Authorization: AccessKey MII...zfg==
Content-Type: application/json
{
"itemIds": [
9588
]
}
Example response:
Parsing response
The response uses distinct types for both fields and values, so these have to be considered when parsing the response. Each value/field has a type
property that specifies the discriminator value for each subtype when parsing. The type is based on the metafield type. A full overview of types can be seen in this table:
Name | Numeric value |
---|---|
Int | 51 |
String | 60 |
Bit | 61 |
DateTime | 64 |
MultiComboValue | 67 |
ComboValue | 68 |
EditComboValue | 69 |
Note | 70 |
MasterItemReference | 80 |
SlaveItemReference | 81 |
Float | 82 |
EditMultiComboValue | 169 |
Tree | 300 |
Link | 350 |
Field Response properties
Name | Type | Description |
---|---|---|
itemId | int | The itemId of the metafield. |
metafieldId | int | The metafieldId of the metafield. |
guid | string/uuid/guid | The ItemGuid of the metafield |
type | enum/int | A value of the enumation mentioned on the above table. Use this to figure out which specified subtype to parse the response as. |
name | string | A language-indenpendent name for the field. Usually the english name. |
description | string | A language-independent description for the field. |
sortIndex | int | A value that indicates how this field should be sorted in relation to other metafields. |
visibilityMetaFieldId | int | Specifies the metafieldId of another metafield, this metafield depends on to be visible. If the value is 0 or null, then the field does not depend on another field. |
visibilityRegex | string | If visibilityMetaFieldId is non-zero, then this is the regex to run on the value of that field to figure out if this field should be shown. |
required | bool | If this field needs to have a value. |
readonly | bool | If the field is marked as readonly or you don’t have write access. |
HasWriteAccess | bool | If you don’t have write access to the field, independent of the field being marked |
showInList | bool | If this field should be shown in the metadata editor in Media Manager. |
system | bool | If this field is something the system absolutely needs to run. |
autoTranslate | enum/string, one of:
| Specifies how values are copied between different languages if a value updated. |
groupId | int | The id of the metafield group this field is part of. |
restrictToAssetType | int | The asset type this field should be visible for. If 0, then the field is visible for all assets |
uploadTagName | string | A special tag for additional metadata extraction from the source file on upload. |
labels | object | Specifies information about how the metafield is described in each available language. The key of the object is the language id. |
labels.labelId | int | The metafieldLabelId of the field in that language. |
labels.languageId | int | The language id of this metafieldLabel |
labels.metafieldId | int | The metafieldId of the main metafield. |
labels.label | string | The title/name/label of the field in this language. |
labels.description | string | A language specific description of the metafield. |
viewType | enum/string, one of
| Describes how this combo field should be rendered as an input. Only available on metafield type |
viewType | enum/string, one of
| Describes how this date field should be rendered as an input. Only available on metafield type |
ItemType | enum/string | The item type of values that are selectable for this field. Only available on metafield type |
maxCount | int | How many items can be selected at most. Or 0 for no limit. Only available on metafield type |
relatedMetaFieldLabelId | int/null | The metafieldLabelId of the SlaveItemReference / MasterItemReference metafield for this MasterItemReference / SlaveItemReference metafield. Only available on metafield type |
relatedMetaFieldId | int/null | The metafieldId of the SlaveItemReference metafield for this MasterItemReference metafield. Only available on metafield type |
maxLength | int | The max number of character that can be specified as a value. Only available on metafield type |
showRichTextEditor | bool | If this note metafield should be rendered as a rich text editor, rather than just a multi-line plaintext editor. Only available on metafield type |
selectToRoot | bool | If selecting a leaf node in the tree should automatically select all values up to the root of the tree. Only available on metafield type |
Group response properties
Name | Type | Description |
---|---|---|
Name | string | The name of this group. |
groupId | int | The id of this group. |
sortIndex | int | How this group should be sorted in relation to other groups. |
visibilityMetaFieldId | int | Specifies the metafieldId of a metafield, this group depends on to be visible. If the value is null, then the group does not depend on a field. |
visibilityRegex | string | If visibilityMetaFieldId is not null, then this is the regex to run on the value of that field to figure out if this group should be shown. |
Value response properties
Name | Type | Description |
---|---|---|
itemId | int | The item id of the asset this value belongs to. |
labelId | int | The metafieldLabelId of the metafield/metafieldLabel this value belongs to. |
type | enum/int | The metafield type of this value. Use to figure out which specific subtype to parse this value as. |
Bit
value response properties
Name | Type | Description |
---|---|---|
value | bool | The value |
DateTime
value response properties
Name | Type | Description |
---|---|---|
value | DateTime/null | The value or null. |
Float
value response properties
Name | Type | Description |
---|---|---|
value | double/null | The value or null. |
Int
value response properties
Name | Type | Description |
---|---|---|
value | int/null | The value or null. |
Link
value response properties
Name | Type | Description |
---|---|---|
value | string/null | The value or null. |
String/Note
value response properties
Name | Type | Description |
---|---|---|
value | string | The value. |
ComboValue/EditComboValue
value response properties
Name | Type | Description |
---|---|---|
value | object | The value. Can be null. |
value.id | int | The language specific id of this combo value. |
value.label | string | The language specific label/name/title of this combo value. |
value.optionValue | string | The language independent text value of this combo. |
value.comboId | int | The language independent id of this combo value. |
MultiComboValue/MultiEditComboValue
value response properties
Name | Type | Description |
---|---|---|
values | array | The selected values. |
values.id | int | The language specific id of this combo value. |
values.label | string | The language specific label/name/title of this combo value. |
values.optionValue | string | The language independent text value of this combo. |
values.comboId | int | The language independent id of this combo value. |
MasterItemReference/SlaveItemReference
value response properties
Name | Type | Description |
---|---|---|
items | array | The selected items. |
items.itemId | int | The itemId of the reference item |
items.title | string | A title for the referenced item. |
items.baseId | int | The baseId of the item. For assets this is the asset id, for member the member id, and so forth. |
items.itemType | enum/string | The item type of this item. Should generally match the item type of the field itself. |
Tree
value response properties
Name | Type | Description |
---|---|---|
values | array | The selected values. |
values.id | int | The language specific id of this tree node. |
values.label | string | The language specific label/name/title of this tree node. |
values.optionValue | string | The language independent text value of this tree node. |
values.treeNodeId | int | The language independent id of this tree node. |
values.parentId | int/null | The language specific id of the parent note, or null if no parent. |
values.labelPath | string | A path containing each label/name/title on the way to this node from the root. |
values.optionValuePath | string | A path containing each optionValue on the way to this node from the root. |
values.parentTreeNodeId | int/null | The treeNodeId of the parent tree node, or null if no parent. |
values.treeNodeIdPath | string | A path containing each treeNodeId on the way to this node from the root. |