Uploading Documents
There are 2 ways documents (or staged documents) can be uploaded to our WebApp:
- By drag-and-dropping on an asset-tile in the WebApp Cockpit
- By using our API
This page focusses on the workflow using our API.
Creating a staged document
Illustrated in steps 1 and 2.
This step is necessary to create an entry of the document in the database.
The client should send a request to POST /external-api/staged-documents
with the following JSON body:
{
"assetIdentifier": "<asset-identifier>",
"name": "<file-name>.<file-extension>"
}
The response includes a signed-URL that to which the document file should be uploaded.
Uploading file
Illustrated in steps 3 and 4.
The client should use the signed-URL to upload the document to our object-storage server.
Example of a request:
curl -v -X PUT -T path/to/<file-name>.<file-extension> <uploadSignedUrl>
Example of a successful response with curl:
StatusCode: 200
Informing upload status
Illustrated in step 5.
Informing of successful upload
If the upload is successful, that is, you get an HTTP 200 response back; you should send a request to our API to inform us that the upload was successful.
That should be done to PUT /external-api/staged-documents/{uuid}
with the following JSON body:
{
"status": 2
}
2
means your upload was successful. For all the statuses, please check ExternalStagedDocument’s Statuses.
Informing of failed upload
If the upload failed, you also need to inform us.
The client should send a request to our API to inform us that the upload failed.
You can do this by sending PUT /external-api/staged-documents/{uuid}
with the following JSON body:
{
"status": 6
}
6
means your upload failed. For all the statuses, please check ExternalStagedDocument’s Statuses.
Architrave GmbH - All rights reserved.
Made in Berlin, proudly international.