This guide explains how to make an upload request using Quatrix API.
Get home_id from GET /profile.
Retrieve a link for uploading a file using POST /upload/link with the following parameters:
Name | Type | Default Value | Description |
name* | string | - | file name |
parent_id* | string | - | the ID of the folder where you would like to upload your file. parent_id = home_id from the previous call |
resolve | boolean | true | if there is an existing file with the same name, the new file will not be overwritten and will have an extension in its name (e.g.: the existing file - test.pgp and the new file - test(1).pgp ) if the value is false and the file with the same name already exists, you'll get an error: TypeError: Failed to fetch |
file_size | number | - | file sizes are measured in bytes (B) |
* required parameters
https://api-test.quatrix.it/api/1.0/upload/link
{ "name": "file_name", "parent_id": "b5774c2a-82c2-4853-ada7-efcad4fdf325", "resolve": true, "file_size": 0 } |
{ "parent_id": "b5774c2a-82c2-4853-ada7-efcad4fdf325", "file_id": "30858a08-1016-4ef7-969c-173dcc836af3", "name": "file_name", "upload_key": "8d1f647e-be74-4f9a-969c-1dc5230d44cc" } |
Copy the upload key and use it for the next call: POST /upload/multipart/{upload_key} or POST /upload/chunked/{upload_key}
Please note that this call cannot be executed in Swagger and you can check the example in Postman below.
https://test-api.quatrix.it/upload/multipart/8d1f647e-be74-4f9a-969c-1dc5230d44cc (where 8d1f647e-be74-4f9a-969c-1dc5230d44cc is the upload key)
Once you enter the upload key, choose files and hit the Send button.
The upload key is valid for 15 minutes and is invalidated once you make a POST /upload/multipart/{upload_key} call. |