Files [v3]
Contents
Create File BLOB
The endpoint creates a new BLOB
which is then can be used for uploading file content directly to document storage server, see Files [v2] | Create-File-by-uploading-content-directly-to-document-storage-server for more details.
Endpoint:
URL |
|
Method |
|
Content-Type |
|
Expected response code |
|
Expected response type |
|
The endpoint accepts the following query parameters:
Parameter | Type | Description | Mandatory |
---|---|---|---|
|
| Length of the blob which is to be uploaded in bytes. | Yes |
|
| MIME type of the content which is to be uploaded. | No |
Example:
filepathname=sample.pdf
content_length=$(stat -f%z "$filepathname")
content_type=application/pdf
curl -v \
-X POST -G \
-H "Authorization: apikey $API_KEY" \
--data-urlencode "content_type=$content_type" \
--data-urlencode "content_length=$content_length" \
$COREDATA_BASE_URL/api/v3/blob/presigned-upload-url/
The response contains a JSON
like this:
{
"blobName": "5a0749a8be6e454a8f2934e8717766a4",
"presignedUrl": "https://home.coredata.is/laika/5a0749a8be6e454a8f2934e8717766a4?AWSAccessKeyId=s3f%3Amyuser&Expires=1698925797&Signature=QhRPtw5mrqA0EqsP6%2FNMlU1DARc%3D"
}
Where:
blobName
– is the name of the newly createdBLOB
instance.presignedUrl
– is a temporary URL for uploading file content directly into theBLOB
.