Document - Overview
A Document is the resource that representts a binary uploaded file, metadata about the file and relationship (attachement) to another resource in the system (ie; a document attached to an Activity resource).
Methods
The API supports the following methods for Activity resources:
- POST - Create
- Inserts a Document by requiring (and matching on) both an
internal_document_id(ie; the ID of the object on your internal system) and aninternal_accound_id(ie; the ID of the object on your internal system).
- Inserts a Document by requiring (and matching on) both an
- GET - Download Link
- Generate a single use, short lived (30 second max expiration) Signed S3 download URL to retrieve the binary file contents.
- DELETE - Delete
- Delete a single Document by
internal_document_id(Can only delete documents which originated from your internal system).
- Delete a single Document by
Resource Representation
The following JSON structure shows the format of a Document resource:
{
"id": integer,
"internal_account_id": string,
"internal_document_id": string,
"attached_to_type": ENUM("project","account","credit", "activity"),
"attached_to_id": string,
"attached_to_internal_id": string,
"upload": {
"filename": string,
"size": string,
"extension": string
},
"created_by": {
"internal_user_id": string,
"email": string,
"full_name": string
},
"created_at": string (RFC 3339 Format - 2022-05-03T17:13:44Z),
"updated_at": string (RFC 3339 Format - 2022-05-03T17:13:44Z)
}
Resource Properties
The following table defines the properties that appear in this resource:
| Key | Type | Definition |
|---|---|---|
| id | integer | The ID of the Document. |
| internal_account_id | string | The ID of the Account on your internal system. |
| internal_document_id | string | The ID of the Document on your internal system. |
| attached_to_type | ENUM("project","account","credit", "activity") | The object type this document is attached to. |
| attached_to_id | integer | The Incentify ID of the object which this document is attached to. |
| attached_to_internal_id | string | The ID of the Object this document is attached to on your internal system. |
| upload.filename | string | The filename of the uploaded document. |
| upload.size | string | size and scale of document upload (eg: 2.5MB) |
| upload.extension | ENUM("pdf", "docx", "xlsx", "csv", ...) | the file extension of document upload |
| created_by.internal_user_id | string | The ID of the user on your internal system. |
| created_by.email | string | The email of the user on your internal system. |
| created_by.full_name | string | The full name of the user on your internal system, or within Incentify. |
| created_at | string | The date and time that the User was created. The value is specified in RFC 3339 Format (2022-05-03T17:13:44Z). |
| updated_at | string | The date and time that the User was last updated. The value is specified in RFC 3339 Format (2022-05-03T17:13:44Z). |