Upload - Create
Purpose
To create an upload (an object in our block storage system which you can post the file contents to) within an account which your API Credentials have access to.
As mentioned, this returns the Upload Resource, which has a single-use, signed S3 URL to upload to. The data post to this signed S3 url must be initiated within 30 seconds before it expires (and if it is a large file thats takes longer to upload, it will not fail as long as it was initiated within 30 seconds).
Request
Endpoint
POST /upload
Authentication
Include your API Key within the x-api-key header as described here.
Request Body Parameters
The following table lists the parameters supported in the JSON POST payload.
*are required- Marked with NO asterisk are optional parameters. If you do not include them in an update request then the current value will be preserved. :::
| Parameter | Type | Definition |
|---|---|---|
| internal_account_id * | string | The unique ID of the Account from your internal system. |
| file_extension * | ENUM("pdf","docx","xlsx","csv",...) | The file extension of the file which will be uploaded. |
Request Body Example
{
"internal_account_id": "p23223",
"file_extension": "pdf"
}
Successful Response
If successful, this method returns an http code of 200 and response body with the following structure:
Response Body
{
"code":200,
"success":1,
"data": {
Upload Resource here (See "Upload - Overview" page)
},
"errors": [],
"meta": {},
"links": {}
}
Error Response
If the request has invalid fields/values, this method returns an http code of 400 and response body with the following structure:
Error Response Body
{
"code":400,
"success":false,
"data": {},
"errors": [
"text describing error here"
],
"meta": {},
"links": {}
}
Properties
The following table defines the properties that appear in this resource:
| Key | Type | Definition |
|---|---|---|
| code | integer | HTTP Status Code (ie; 200, 403, etc). |
| success | integer | Either 1 (success) or 0 (fail). |
| data | object | Upload data is returned. The data structure of the Upload is a Upload Resource. |
| errors | object | If the request fails, this will contain information about the error. |
| meta | object | Contains information about pagination and total record count. |
| links | object | Contains pre-built links for forward/backward pagination. |