Asset upload
| /dam/assets/bin/persist Upload asset to the system. |
Semantic is the same as in chunked asset upload. Within this endpoint it’s possible to upload file per one request without splitting to chunks.
Resource path |
|
HTTP method |
POST |
Request content type |
multipart/form-data |
Response content type |
|
Form Parameters
| AssetUploadRequest.path should be provided to the OMN known directory. |
| Name | Description | Required | Default | Pattern |
|---|---|---|---|---|
params |
Upload parameters AssetUploadRequest |
X |
||
payload |
Blob file |
X |
Return Type
PimType with filled ResponsesType
Response type contains status and info about upload asset operation.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input |
|
409 |
File already exists |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Upload a file
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{
\"path\":\"/MAM/demo/\",
\"tid\": \"AAAAA-AAAAA-AAAAAA-AAAAAA\",
\"doPreviewsAsync\": true,
\"doOverwrite\": true
}";type=application/json''
Request body AssetUploadRequest
{
"path":"/MAM/demo/",
"tid": "AAAAA-AAAAA-AAAAAA-AAAAAA",
"doPreviewsAsync": true,
"doOverwrite": true
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn">
<responses>
<response action="create"
dataType="asset"
id="86670"
path="/MAM/demo/file.jpg"
tid="AAAAA-AAAAA-AAAAAA-AAAAAA">
<status>SUCCESS</status>
<description>The asset has been uploaded</description>
</response>
</responses>
</pim>
Error response
No access to the asset
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.apollon.de/omn">
<details>
<itm key="supportId">9fdfc6ce-6999-4f3b-8513-be5c431974ee</itm>
</details>
<issues>
<itm key="code">1000</itm>
<itm key="description">An unknown internal error occurred</itm>
<itms type="details">
<itm key="errorMessage">No permissions to upload by path: /demo/file.jpg</itm>
</itms>
</issues>
<status>ERROR</status>
</response>
Assets already exists
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.apollon.de/omn">
<details>
<itm key="supportId">d2540d63-e9b5-4647-b875-bcb0c9dfabe5</itm>
</details>
<issues>
<itm key="code">1003</itm>
<itm key="description">The resource already exists</itm>
<itms type="details">
<itm key="errorMessage">File already exists by path: '/demo/file.jpg'</itm>
</itms>
</issues>
<status>ERROR</status>
</response>