Persist assets
| /dam/assets/persist Saves asset information and asset attributes details. |
Allows to
Resource path |
/api/core/v1/dam/assets/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Asset attribute persisting
Asset attributes are stored in AssetType.vals. More info about asset attributes
| Only provided attribute values are persisted, other values that are not provided in AssetType.vals will be not changed. |
| Only values of attributes registered in OMN could be saved. |
Keyword link persisting
Keyword links are stored in AssetType.links. See below for sample
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2024-05-08T09:42:06.853Z</itm>
<itm key="sourceEnv">ocd_dev</itm>
</meta>
<assets>
<asset id="58525" parent="7CFD9FB3-8124-4363-8C06-B844CC58249C" tid="5B8EF672-A396-43BC-B880-E8B1FC2F7376" type="IMG">
<name>MyAsset.jpg</name>
<links>
<itms mode="delta" type="kwds">
<itm pos="1">/MyRootKW/MySubKW</itm>
</itms>
</links>
</asset>
</assets>
</pim>
| Only existing keywords can be linked. Non-existent keywords won’t be created automatically. |
Body parameters
Accepts PimType with AssetsType
Return Type
PimType with statuses ResponsesType about each persisted asset.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with list of responses |
|
500 |
Error in ResponseType |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Save asset attributes and new name
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '<BODY>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<assets>
<asset parent="01427CB0-AF41-41CF-96FC-51EC7B6ADEC1"
tid="6FC0022A-E978-4ADF-ABFE-DBF0BE99042F"
type="IMG">
<name>100192855000_96p.jpg</name>
<vals>
<val attr="STRING_SIMPLE">
<itm>string</itm>
</val>
<val attr="NUMBER_SIMPLE">
<itm>6395629</itm>
</val>
<val attr="ENUMERATION_L" type="multi_loc">
<i18n loc="en_EN">
<itm pos="0">Brown</itm>
<itm pos="1">Yellow</itm>
</i18n>
</val>
<val attr="xmp.IPTC.Description" type="xmp">
<itm>100192296041383437</itm>
</val>
<val attr="xmp.dc:description" type="xmp">
<itm>100192296041383437</itm>
</val>
<val attr="xmp.dc:subject" type="xmp">
<itm>1001/100192/855000/19;</itm>
</val>
<val attr="xmp.tiff.Orientation" type="xmp">
<itm>1</itm>
</val>
<val attr="xmp.IPTC.Keywords" type="xmp">
<itm>1001/100192/855000/19;</itm>
</val>
<val attr="xmp.dc:format" type="xmp">
<itm>image/jpeg</itm>
</val>
<val attr="xmp.IPTC.Creator" type="xmp">
<itm>p</itm>
</val>
<val attr="xmp.exif:ExposureTime" type="xmp">
<itm>1/160</itm>
</val>
</vals>
</asset>
</assets>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-03T07:28:00.168Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="ASSET" tid="71A1021B-786C-4538-8883-70A1C6754034" action="update">
<status>SUCCESS</status>
<description>The asset has been saved successfully</description>
</response>
</responses>
</pim>
Link keywords to asset
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '<BODY>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2024-05-08T09:42:06.853Z</itm>
<itm key="sourceEnv">ocd_dev</itm>
</meta>
<assets>
<asset id="58525" parent="7CFD9FB3-8124-4363-8C06-B844CC58249C" tid="5B8EF672-A396-43BC-B880-E8B1FC2F7376" type="IMG">
<name>MyAsset.jpg</name>
<links>
<itms mode="delta" type="kwds">
<itm pos="0">/MyRootKeyword</itm>
<itm pos="1">/AnotherRootKeyword/MySubKeyword</itm>
</itms>
</links>
</asset>
</assets>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-03T07:28:00.168Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="ASSET" tid="71A1021B-786C-4538-8883-70A1C6754034" action="update">
<status>SUCCESS</status>
<description>The asset has been saved successfully</description>
</response>
</responses>
</pim>
Error responses
The asset doesn’t exist
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-03T07:46:16.200Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="asset" tid="71A1021B-786C-4538-8883-70A1C675403422" action="update">
<status>ERROR</status>
<description>The asset does not exist</description>
</response>
</responses>
</pim>
The keyword doesn’t exist
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pim xmlns="http://www.apollon.de/omn">
<meta>
<itm key="messageType">response</itm>
<itm key="messageTime">2024-05-13T04:54:05.030Z</itm>
<itm key="refMessageId">1131</itm>
<itm key="sourceEnv">ocd_dev</itm>
</meta>
<responses>
<response dataType="asset" tid="5B8EF672-A396-43BC-B880-E8B1FC2F7376">
<status>SUCCESS</status>
<issues type="1002">
<itm key="description">Keyword could not be linked: Keyword with path '/nonexistentkeyword' not found.</itm>
</issues>
</response>
</responses>
</pim>
No access to the asset
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-03T07:46:16.200Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="asset" tid="71A1021B-786C-4538-8883-70A1C675403422" action="update">
<status>ERROR</status>
<description>The asset does not exist</description>
</response>
</responses>
</pim>
No access rights to save some attributes
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-04T09:15:35.301Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="ASSET" tid="71A1021B-786C-4538-8883-70A1C6754034" action="update">
<status>WARNING</status>
<description>The asset has been saved successfully. Some attributes were not saved due to Access Rights</description>
</response>
</responses>
</pim>