DC 5.9 Uploading and replacing assets
Another very important part of the API is to upload new assets and/or replace existing assets.
Upload and replace both follows the same pattern
Initiate the upload
Upload the physical bytes
Initiate the upload
URL: /digizuitecore/legacyservice/api/asset/upload/initiate
Method: POST
Auth required: YES
Request properties
Name | Example | Description |
---|---|---|
|
| The filename of the file to be uploaded |
|
| Parameter used to determine where the upload came from. This is used in automations to control what should happen with the upload |
|
| Optional parameter used for crops to populate the cropname |
|
| Optional parameter used to link the crop the the parent asset from which it was cropped |
|
| Optional parameter used to determine which catalog folder the asset should go into |
Example request:
POST https://<my-dam>/digizuitecore/legacyservice/api/asset/upload/initiate
Authorization: AccessKey MII...zfg==
Content-Type: application/json
{
"fileName": "file.jpg",
"computerName": "ApiUpload"
}
Example response:
Uploading the physical bytes
This API is meant to be called a number of times until all bytes has been uploaded. The intention is to split the file bytes into one or more chunks and upload the chunks one by one.
The bytes must be sent in the request body and there parameters below are all parsed as query parameters.
URL: /digizuitecore/legacyservice/api/asset/upload/chunkupload
Method: POST
Auth required: YES
Request properties
Name | Example | Description |
---|---|---|
|
| Query parameter with Id from Initiate asset upload call used to link the bytes to the asset |
|
| Query parameter with the number identifying the upload chunk |
|
| Query parameter indicating whether all chunks are uploaded or not. True indicates that all chunks has been uploaded. |
|
| Optional query parameter used if the upload should replace another asset |
|
| Optional query parameter used alongside ReplacedAssetId to indicate if metadata should be kept or reset on replace. 0 is the default and means it is kept and 1 means it will be reset. |
Example request:
POST https://<my-dam>/digizuitecore/legacyservice/api/asset/upload/uploadChunk?uploadId=12036&chunkNumber=1&finished=true
Authorization: AccessKey MII...zfg==
Request payload: [<Bytes>]