Upload file
Initiate Upload
curl -i -X POST "https://example.ziik.io/api/upload"
-H "Authorization: Bearer aaaaaaaaa.bbbbbbbbb.cccccccccc"
-d "{ [...] }"
The above command returns 201 Created on success
HTTP/1.0 201 Created
{
'uuid': 'AB3432BAF',
'key': '/autogenerated,
'url': 'https://s3.bucket.host/path?withArguments=true',
'headers': {
'x-amz-acl': [
'private'
],
'Content-Type': 'application/pdf'
},
'file': 1234,
}
This endpoint adds files to an existing entity.
HTTP Request
POST https://example.ziik.io/api/upload
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
id | Integer | Yes | The ID of the entity to add files to |
type | String | Yes | The type of entity - contents, users, units, see below |
content_type | String | Yes | Mimetype of the file to be uploaded |
filename | String | Yes | File name. |
Entity Types
Value | Description |
---|---|
users | User profile |
units | Unit profile |
departments | Department profile |
paragraphs | Handbook paragraph |
groups | Discussion group |
folders | Document folder |
contents | News story, debate, event, manual, faq |
comments | Comment |
messages | Chat message |
logo | Site logo |
mobile_logo | Logo for mobile apps |
mobile_bg | Background image for mobile apps home screen |
suppliers | Supplier attached files |
supplier_image | Supplier image |
Permissions Required
- Edit access to the entity
Upload the file
curl -i -X PUT "https://s3.bucket.host/path?withArguments=true"
-H "[HEADERS FROM INITIATION]"
-d [FILEDATA]
The above command returns a 201 Created header on success:
HTTP/1.0 201 Created
This endpoint receives the upload of the actual file. It is direct upload to an S3 compatible service, so more information is available at Amazon Web Services
HTTP Request
PUT https://s3.bucket.host/path?withArguments=true
Prerequisites
- A url from the file upload initiation process
Finalise Upload
curl -i -X POST "https://example.ziik.io/api/file/1234/finalise"
-H "Authorization: Bearer aaaaaaaaa.bbbbbbbbb.cccccccccc"
-d "{ [...] }"
The above command returns 204 No Content on success
HTTP/1.0 204 No Content
This endpoint finalises the upload, registering the upload and begins the processing of the file, if applicable (e.g. transcoding a video)
HTTP Request
POST https://example.ziik.io/api/file/ID/finalise
URL Parameters
Parameter | Type | Description |
---|---|---|
ID | Integer | The ID of the file to finalise |
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
key | String | Yes | Validation key from the initiation process |