Database Attachments

Upload an attachment

POST
/api/records/{country}/{key}/files

Uploads a file to the database storage and attaches it to the record.

Authorization

bearerAuth
AuthorizationBearer <token>

Access token from POST /oauth2/token (valid for 300 seconds).

In: header

Path Parameters

country*string

Lowercase ISO country code where the record is stored. One REST API instance serves one country (for https://se-restapi-mt-01.api.incountry.io it is se).

key*string

Record key (record_key) of the record.

Request Body

multipart/form-data

file*unknown

The file to upload.

Response Body

application/json

curl -X POST "https://example.com/api/records/se/d1c2e12cfeababc8b95daf6902e210b1/files" \  -F file="null"
{  "file_id": "5416a334-6ce6-4e3b-9a0d-464cb417c094",  "filename": "index.html",  "hash": "78701b482fc9738e26f32254bbe7d71990f5025a9b728046a280a3822cdf5cad",  "mime_type": "text/html",  "size": 279,  "created_at": "2021-03-26T11:36:44.000Z",  "updated_at": "2021-03-26T11:36:44.000Z",  "download_link": "https://se-mt-01.incountry.io/v2/storage/records/se/310459560d9e757d6e51be45a5aad862fbb81c52d72a026e75d21366ac223a40/attachments/5416a334-6ce6-4e3b-9a0d-464cb417c094"}