Variations API
Provides operations on OMN asset variations.
Retrieve variations
| /dam/assets/variations/retrieve Retrieves asset variations. |
Variation object represents link between assets.
Resource path |
/api/core/v1/dam/assets/variations/retrieve |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
Body parameters
Specified by VariationRequest
Return Type
OmnType with filled VariationsType. More info VariationType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
OmnType with list of asset variations |
|
500 |
Error in ResponseType |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Get asset variations
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"assetPaths": ["/MAM/demo/copies/tempAR/pcUXFux_77I.jpg", "/MAM/demo/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500_print_variation.jpg"]
}'
Request body examples:
{
"assetIds": [12333]
}
{
"assetTids": ["38043B75-5BB3-44CE-AFD1-401503C6F322"]
}
{
"assetPaths": ["/RNC/Dir1/Dir2/file.jpg"]
}
<?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-09-01T11:41:47.507Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<variations>
<variation assetId="86430" assetTid="DB32DAAC-6A80-4BEB-A09C-C020CA941F4E"/>
<variation assetId="87960"
assetTid="C6E3F14B-092A-4267-9A5D-C16FE4295DC3"
parentTid="DB32DAAC-6A80-4BEB-A09C-C020CA941F4E">
<meta>
<itm key="variationType">Print</itm>
</meta>
</variation>
<variation assetId="87961"
assetTid="11319367-DE26-4FB8-9148-3C341766C1BA"
parentTid="C6E3F14B-092A-4267-9A5D-C16FE4295DC3">
<meta>
<itm key="variationType">Print</itm>
</meta>
</variation>
</variations>
</pim>
Retrieve variation types
| /dam/assets/variations/types Retrieves asset variation types. |
Resource path |
/api/core/v1/dam/assets/variations/types |
HTTP method |
GET |
Response content type |
|
Return Type
OmnType with filled VariationTypesType. More info VariationTypeType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
OmnType with filled VariationTypesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Request examples
curl --location --request GET 'http://<OMN_SERVER>/api/core/v1/dam/assets/variations/types' \
--header 'Authorization: Bearer <TOKEN>' \
--data-raw ''
Response example
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn">
<variationTypes>
<variationType tid="Print"/>
</variationTypes>
</pim>
Upload as Variation
| /dam/assets/variations/bin/persist Upload file as variation to the system. |
Resource path |
|
HTTP method |
POST |
Request content type |
multipart/form-data |
Response content type |
|
Form Parameters
| AssetVariationUploadRequest.tid should be provided to the OMN asset. |
| Name | Description | Required |
|---|---|---|
params |
Upload parameters AssetVariationUploadRequest |
X |
payload |
Blob file |
X |
Return Type
PimType with filled ResponsesType
Response type contains status and info about uploaded asset variation.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input |
|
404 |
The requested resource could not be found |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
1. Upload a file as variation
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{
\"tid\":\"52F78637-63AE-4F3E-8D4B-664E070C6AB8\",
\"variationType\": \"Print\"
}";type=application/json'
{
"tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
"variationType": "Print"
}
<?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-07-16T09:30:46.743Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="variation"
tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
action="update">
<status>SUCCESS</status>
<description>Asset variation has been created</description>
</response>
</responses>
</pim>
2. Upload a file as variation with specified name
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{
\"tid\":\"52F78637-63AE-4F3E-8D4B-664E070C6AB8\",
\"variationType\": \"Print\",
\"variationFileName\": \"assetVariation.png\"
}";type=application/json'
{
"tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
"variationType": "Print",
"variationFileName": "assetVariation.png"
}
<?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-07-16T09:30:46.743Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="variation"
tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
action="update">
<status>SUCCESS</status>
<description>Asset variation has been created</description>
</response>
</responses>
</pim>
Error response
<?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-07-16T09:45:15.768Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="variation"
tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
action="update">
<status>ERROR</status>
<description>Asset is not available by access rights</description>
</response>
</responses>
</pim>