Chunked upload. Start
| /dam/assets/bin/chunked/start Initializes a chunk upload session for the file |
Chunk upload workflow consist of 3 general steps:
Resource path |
/api/core/v1/dam/assets/bin/chunked/start |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
Return Type
OmnType with filled ResponsesType
Response type contains upload tid - the unique identity of the upload session. Upload tid is required for next upload steps.
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
OmnType with filled ResponsesType |
|
400 |
Invalid input provided |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
Start upload session
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/bin/chunked/start' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"path":"/MAM/demo/file2.jpg",
"tid": "AAAAA-AAAAA-AAAAAA-AAAAAA",
}'
Request body AssetUploadRequest
{
"tid":"0AA31C0C-F2AE-422C-9C6A-25BAB368706E",
"path": "/MAM/demo/filename.jpg"
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn">
<responses>
<response tid="9f9417cc-031b-4bf4-ae98-e1df1fc93fef">
<status>SUCCESS</status>
<description>Chunk upload could be started by upload UUID/tid</description>
</response>
</responses>
</pim>
Error responses
File already exists
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.apollon.de/omn">
<details>
<itm key="supportId">f21311c9-a868-4d4e-bc48-adaa96436335</itm>
</details>
<issues>
<itm key="code">1000</itm>
<itm key="description">An unknown internal error occurred</itm>
<itms type="details">
<itm key="errorMessage">File already exists by path: '/demo/file.jpg'</itm>
</itms>
</issues>
<status>ERROR</status>
</response>
File already exists with the provided tid, but in another path
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://www.apollon.de/omn">
<details>
<itm key="supportId">f21311c9-a868-4d4e-bc48-adaa96436335</itm>
</details>
<issues>
<itm key="code">1000</itm>
<itm key="description">An unknown internal error occurred</itm>
<itms type="details">
<itm key="errorMessage">File already exists by path: '/demo/file.jpg'</itm>
</itms>
</issues>
<status>ERROR</status>
</response>
No access to the destination
<?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>
No destination
<?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 target directory by path: '[demo]' in rnc: 'MAM'</itm>
</itms>
</issues>
<status>ERROR</status>
</response>