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
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'
Request body AssetUploadRequest
{
"tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
"variationType": "Print"
}
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-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
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'
Request body AssetUploadRequest
{
"tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
"variationType": "Print",
"variationFileName": "assetVariation.png"
}
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-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
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-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>