Skip to main content

Upload a Media

This endpoint uploads a media.

info

This operation requires authentication.

HTTP Request

POST /api/v2/pm/upload/

Parameters

NameInTypeRequiredDescription
filebodyblobtrueThe file to upload
filetypebodystringfalseThe type of the file to upload
filenamebodystringfalseThe name of the file to upload
durationbodyintegerfalseThe duration (in seconds) of the video or audio track to upload
totalfilesizebodyintegerfalseThe size of the file to upload
md5bodystringfalseThe MD5 of the file to upload

Example Body Parameters

{
file: "blob"
}

Example Request

const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/pm/upload/',
{
method: 'POST',
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_urlstringfalsenoneThe file url
file_uuidstringfalseread-onlyThe file id

Example responses

{
"file_url": "string",
"file_uuid": "string"
}