upload
Get upload URL
Changed onReturns the URL for the subsequent file upload.
For example, you can upload it via curl:
-H "Content-Type: multipart/form-data"
-F "data=@movie.mp4" "%UPLOAD_URL%"```
Two types of an upload are supported:
- single request upload (multipart request)
- and resumable upload.
##### Multipart upload
This type of upload is a simpler one but it is less
reliable and agile. If a `Content-Type`: multipart/form-data header is passed in a request our service indicates
upload type as a simple single request upload.
This type of an upload has some restrictions:
- Max. file size - 2 Gb
- Only one file per request can be uploaded
- No possibility to restart stopped / failed upload
##### Resumable upload
If `Content-Type` header value is not equal to `multipart/form-data` our service indicated upload type
as a resumable upload.
With a `Content-Range` header current file chunk range and complete file size
can be passed. If a network error has happened or upload was stopped you can continue to upload a file from
the last successfully uploaded file chunk. You can request the last known byte of uploaded file from server
and continue to upload a file.
##### Get upload status
To GET an upload status you simply need to perform HTTP-GET request to a file upload URL.
Our service will respond with current upload status,
complete file size and last known uploaded byte. This data can be used to complete stopped upload
if something went wrong. If `REQUESTED_RANGE_NOT_SATISFIABLE` or `INTERNAL_SERVER_ERROR` status was returned
it is a good point to try to restart an upload
post/uploads
Request
- Base URLhttps://botapi.tamtam.chat
- URLhttps://botapi.tamtam.chat/uploads
- AuthAPI key in query parameter access_token
Query parameters
type'image' | 'video' | 'audio' | 'file' required
Type of file uploading
Uploaded file type: photo, audio, video, file
Response
Returns URL to upload attachment
Changes
- breaking
removed the enum value
photofrom thequeryrequest parametertype - info
added the new enum value
imageto thequeryrequest parametertype
- breaking