Uploading assets to the library
Editing the asset metadata
To edit the metadata of an asset, use the following CMS API call:
API
PATCH: /instances/file/{{document_type}}/{{document_id}}
The {{document_type}} in the URL is the system name of the document type. The pre-created document type name is “ccm1_dam_brand_assets”.
The {{document_id}} in the URL is the ID of the document to be updated.
The request payload content type is the application/json with valid asset metadata details.
Request body
{
"name": "nature.jpg",
"traits": {
"ccm1_dam_business": {
"ccm1_dam_business": {
"dam_approval_state": "approved0",
"dam_asset_type": "photo_nature40",
"dam_tags": [
"Nature"
]
}
}
}
}
The API call returns the following response:
Response
{
"id": "37544745-e6c0-4a01-9678-ec35b3b763ab",
.....
"name": "nature.jpg",
"parent_folder_id": "50a240af-3c0a-4c4d-91c6-2324ecddabd6",
"traits": {
.......
"ccm1_dam_business": {
"ccm1_dam_business": {
"dam_approval_state": "approved0",
"dam_asset_type": "photo_nature40",
"dam_tags": [
"Nature"
]
}
}
}
.....
}