DC 6.0 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

Name

Example

Description

itemIds

[9588, 9589]

The item ids of the assets to request metadata for. Multiple ids can be passed.

labelIds

[10438, 10437] Requests keywords in english and danish only.

If you only want metadata for certain metafield label ids, then use this parameter.

fieldItemIds

[5532, 5537] Requests only the title and description metafields.

If you only want certain metafield, then you can pass the item ids of the metafields with this parameter.

fieldItemGuids

["c8bb4af3-1598-4ea4-8d7a-98d54eead977", "5eb3eefc-a043-410f-89b0-29ed3ef37078"]

If you only want certain metafield, then you can pass the item guids of the metafields with this parameter.

groupIds

[10025] All fields in the “Asset info” metadata group.

If you only want fields in a specific metadata group, then the group ids can be passed here.

onlyShowInList

true or false

If true then only fields with show in list selected will be returned. If false, fields will be returned irrespective of the value of show in list.

languages

[1, 3]

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:

{ "groups": [ { "name": "Asset info", "groupId": 10025, "sortIndex": 0, "iterative": false, "visibilityRegex": null, "visibilityMetafieldId": null } // More objects omitted ], "fields": [ { "type": 70, "maxLength": 0, "showRichTextEditor": false, "itemId": 9516, "metafieldId": 50384, "guid": "d658fe27-dbb2-415a-9771-f6781fd65f66", "name": "Message", "description": "", "sortIndex": 0, "visibilityMetaFieldId": 0, "visibilityRegex": "", "required": false, "readonly": true, "hasWriteAccess": false, "showInList": true, "system": false, "autoTranslate": "Overwrite", "groupId": 50009, "restrictToAssetType": 0, "uploadTagName": "", "label": "", "iterative": false, "labels": { "3": { "labelId": 51456, "languageId": 3, "metafieldId": 50384, "label": "Message", "description": "" }, "1": { "labelId": 51481, "languageId": 1, "metafieldId": 50384, "label": "Message", "description": "" } } } // More fields omitted ], "values": [ { "value": "", "type": 70, "itemId": 9588, "labelId": 51456 } // More values omitted ] }

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

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

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 readonly.

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:

  • None

  • CreateIfMissing

  • Overwrite

  • AutotranslateCreateIfMissing

  • AutotranslateOverwrite

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

  • Combo

  • Radio

Describes how this combo field should be rendered as an input. Only available on metafield type ComboValue.

viewType

enum/string, one of

  • Date

  • DateTime

Describes how this date field should be rendered as an input. Only available on metafield type DateTime.

ItemType

enum/string

The item type of values that are selectable for this field. Only available on metafield type MasterItemReference and SlaveItemReference.

maxCount

int

How many items can be selected at most. Or 0 for no limit. Only available on metafield type MasterItemReference and SlaveItemReference.

relatedMetaFieldLabelId

int/null

The metafieldLabelId of the SlaveItemReference / MasterItemReference metafield for this MasterItemReference / SlaveItemReference metafield. Only available on metafield type MasterItemReference and SlaveItemReference.

relatedMetaFieldId

int/null

The metafieldId of the SlaveItemReference metafield for this MasterItemReference metafield. Only available on metafield type MasterItemReference and SlaveItemReference.

maxLength

int

The max number of character that can be specified as a value. Only available on metafield type Note and String.

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 Note.

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 Tree.

 

Group response properties

Name

Type

Description

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

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

Name

Type

Description

value

bool

The value

 

 

DateTime value response properties

Name

Type

Description

Name

Type

Description

value

DateTime/null

The value or null.

 

Float value response properties

Name

Type

Description

Name

Type

Description

value

double/null

The value or null.

 

Int value response properties

Name

Type

Description

Name

Type

Description

value

int/null

The value or null.

 

Link value response properties

Name

Type

Description

Name

Type

Description

value

string/null

The value or null.

 

String/Note value response properties

Name

Type

Description

Name

Type

Description

value

string

The value.

 

ComboValue/EditComboValue value response properties

Name

Type

Description

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

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

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

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.