APIMedia
Upload a chunk
Send one piece of a large file to an open chunked upload session.
Send each chunk once, with its number. Read the flow on Start a chunked upload.
Request
- Method:
POST - URL:
https://app.socialk.it/core/api/<workspaceUuid>/media/chunked/<uploadUuid>/upload - Authorization:
Bearer <personal-key> - Content-Type:
multipart/form-data - Roles: Admin, Member (see Permissions)
Path parameters
| Parameter | Type | Description |
|---|---|---|
workspaceUuid | string | UUID of the workspace. |
uploadUuid | string | The upload_uuid from Start a chunked upload. |
Body
Form fields:
| Field | Type | Required | Description |
|---|---|---|---|
chunk | file | Yes | The piece of the file. At most chunk_size bytes. |
chunk_index | integer | Yes | Number of the chunk, from 0 to total_chunks - 1. |
Example
curl -X POST 'https://app.socialk.it/core/api/<workspaceUuid>/media/chunked/<uploadUuid>/upload' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <personal-key>' \
-F 'chunk=@part_0000' \
-F 'chunk_index=0'Response
{
"chunk_index": 0,
"part_number": 1
}part_number is chunk_index plus one.
{
"message": "Unauthenticated."
}The 422 above means the session does not exist, has been cancelled or finished, or belongs to someone else. A chunk that is too big or a chunk_index outside the range gives a 422 under chunk or chunk_index.