Upload a Media in Chunks
This endpoint performs the chunk upload of a file.
info
This operation requires authentication
info
The client must split the file into chunks and send to the server in series. After all the chunks have been uploaded the client must call the Chunk Upload Done endpoint with the given filename
parameter to finalize the upload and retrieve the File.
HTTP Request
POST /api/v2/pm/upload/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
file | body | blob | true | The file to upload |
uuid | body | string | true* | The file uuid returned by the first chunk upload. It is required only when partindex > 0 |
partindex | body | integer | true | The index of the chunk part to upload. It starts at 0 and reaches totalparts -1 |
totalparts | body | integer | true | The number of total parts of the chunk to upload |
filetype | body | string | false | The type of the file to upload |
totalfilesize | body | integer | false | The size of the file to upload |
partbyteoffset | body | integer | false | The chunk byte offset |
chunksize | body | integer | false | The size of the chunk |
filename | body | string | false | The name of the file to upload |
Example Body Parameters
- JSON
{
"partindex": "integer",
"totalparts": "integer",
"file": "blob"
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"partindex": "integer",
"totalparts": "integer",
"file": "blob"
}';
const headers = {
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/pm/upload/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/pm/upload/ \
-H "Authorization: Bearer {access_token}"
--body-data 'partindex=0&totalparts=5' \
'https://apiv2.quentrix.com/api/v2/pm/upload/'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
file_uuid | string | false | read-only | The file id |
Example responses
- 200
{
"file_uuid": "string"
}