Version upload
| /dam/assets/versions/bin/persist Upload asset as version to the system. |
Semantic is the same as in chunked version upload. Within this endpoint it’s possible to upload file per one request without splitting to chunks.
Upload as version feature will create a version for file that currently is on the system and then replace the file on the system with the uploaded.
Resource path |
|
HTTP method |
POST |
Request content type |
multipart/form-data |
Response content type |
|
Form Parameters
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
params |
Version upload and creation parameters AssetVersionUploadRequest |
X |
||
payload |
Blob file |
X |
Return Type
PimType with filled ResponsesType
Response type contains status and info about upload asset version operation.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input provided |
|
404 |
No asset by tid |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Upload file version
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/versions/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{\"versionComment\": \"Created before upload via API\", \"tid\":\"F103F147-428C-4427-AA65-8A46AE066803\"}";type=application/json'
{
"tid":"F103F147-428C-4427-AA65-8A46AE066803",
"versionComment": "Created before upload via API",
"timeoutDate": "{Date in the ISO8601 format}",
"protectedAfterDate": "{Date in the ISO8601 format}",
"protectedBeforeDate": "{Date in the ISO8601 format}"
}
<?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="asset"
tid="F103F147-428C-4427-AA65-8A46AE066803"
action="update">
<status>SUCCESS</status>
<description>Old file has been versioned and new file has been uploaded</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="asset"
tid="BA7A3E08-A48B-47FE-8150-6986A61588732"
action="update">
<status>ERROR</status>
<description>Asset is not available by access rights</description>
</response>
</responses>
</pim>