Skip to main content
Skip table of contents

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

/api/v3/blob/presigned-upload-url/

Method

POST

Content-Type

application/json

Expected response code

200

Expected response type

JSON

The endpoint accepts the following query parameters:

Parameter

Type

Description

Mandatory

content_length

Integer

Length of the blob which is to be uploaded in bytes.

Yes

content_type

String

MIME type of the content which is to be uploaded.

No

Example:

BASH
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:

JSON
{
    "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 created BLOB instance.

  • presignedUrl – is a temporary URL for uploading file content directly into the BLOB.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.