Skip to main content

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

NameInTypeRequiredDescription
filebodyblobtrueThe file to upload
uuidbodystringtrue*The file uuid returned by the first chunk upload. It is required only when partindex > 0
partindexbodyintegertrueThe index of the chunk part to upload. It starts at 0 and reaches totalparts -1
totalpartsbodyintegertrueThe number of total parts of the chunk to upload
filetypebodystringfalseThe type of the file to upload
totalfilesizebodyintegerfalseThe size of the file to upload
partbyteoffsetbodyintegerfalseThe chunk byte offset
chunksizebodyintegerfalseThe size of the chunk
filenamebodystringfalseThe name of the file to upload

Example Body Parameters

{
"partindex": "integer",
"totalparts": "integer",
"file": "blob"
}

Example Request

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);
});

Responses

StatusMeaningDescriptionSchema
200OKResponse status codeInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
file_uuidstringfalseread-onlyThe file id

Example responses

{
"file_uuid": "string"
}