Upload - Overview
An Upload is a placeholder record for a file you are uploading. The only context which this resource has is an extension and an internal account id. The extension is used to generate a random object key for our internal S3 storage engine, which we can gaurentee is not already in use and also lock that key for a reasonable amount of time while the binary file uploads and virus scan takes place. The internal account id is used to ensure cross account access issues are impossible in subsequent API calls with the response.
Note, if an upload fails there is no clean up to do from your side, we will sweep up any unused or incomplete upload object keys for future use on an interval.
Methods
The API supports the following methods for Upload resources:
- POST - Create
- Insert an Upload which requires a file extension (for the generated file name on our system) and an
internal_accound_id(ie; the ID of the account on your internal system - used to block cross account access errors).
- Insert an Upload which requires a file extension (for the generated file name on our system) and an
Resource Representation
Each upload POST returns a single object in the response, with the generated single-use, signed S3 url to post the binary file to for upload, and a unique upload_id to use in subsequent API calls to create a Document with the associated upload. The data post to the 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).
The following JSON structure shows the format of an Activity resource:
{
"upload_url": string,
"upload_id": string
}
Resource Properties
The following table defines the properties that appear in this resource:
| Key | Type | Definition |
|---|---|---|
| upload_url | string | The signed S3 url that you can POST the binary file to in order to upload it. |
| upload_id | string | The unique id for this upload, which you need for subsequent API calls to the document resource. |