REST APIs
Rest api for files
Last updated
Rest api for files
Last updated
Prefix: /internal/services/files/v1/
GET
/internal/services/files/v1/:company_id/files/:file_id
This route is called to get the metadata related to the file_id
mentioned in the URL
GET
/internal/services/files/v1/companies/:company_id/files/:file_id/download
This route is called to download the file related to the file_id
mentionned in the URL
GET
/internal/services/files/v1/companies/:company_id/files/:file_id/thumbnails/:id
This route is called to download the thumbnail related to the file_id
mentionned in the URL
DELETE
/internal/services/files/v1/companies/:company_id/files/:file_id
This route is called to delete the file related to the file_id
mentionned in the URL
To upload a single file, you must call this route and put the file binary data into a "file" multipart section.
POST
/internal/services/files/v1/companies/:company_id/files?thumbnail_sync=1
This route is called to upload a file when chunk upload is not necessary. Thumbnail_sync: when set then backend will wait up to 10 seconds for preview to be generated before reply.
To upload a file in multiple chunk you must first initial the file itself, and then upload into the file.
The file initialization and following upload calls takes this parameters as a query string:
filename: string, file name
type: string, mime type for the file
total_chunks: number, total number of chunk to be uploaded
total_Size: number, sum of every chunk size (total file size)
chunk_number: number, current chunk uploaded, set it to undefined during file creation process.
thumbnail_sync: when set then backend will wait up to 10 seconds for the preview to be generated before to reply.
POST
/internal/services/files/v1/companies/:company_id/files/?filename...
This route should first be called without data to initialise the entity for multi-chunk, then chunks must be sent on other route below
POST
/internal/services/files/v1/companies/:company_id/files/:file_id/?totalChunks...
Overwrite a file (check user belongs to company) User can call this if the file was not already uploaded. If file already exist only apps can do this (users cannot directly overwrite a file).
thumbnail_sync
boolean
File
object
The file which will be uploaded