Upload a Media
This endpoint uploads a media.
info
This operation requires authentication.
HTTP Request
POST /api/v2/pm/upload/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
file | body | blob | true | The file to upload |
filetype | body | string | false | The type of the file to upload |
filename | body | string | false | The name of the file to upload |
duration | body | integer | false | The duration (in seconds) of the video or audio track to upload |
totalfilesize | body | integer | false | The size of the file to upload |
md5 | body | string | false | The MD5 of the file to upload |
Example Body Parameters
- JSON
{
file: "blob"
}
Example Request
- JavaScript
- Bash
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);
});
# You can also use wget
curl -X POST /api/v2/pm/upload/ \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Response status code | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
file_url | string | false | none | The file url |
file_uuid | string | false | read-only | The file id |
Example responses
- 200
{
"file_url": "string",
"file_uuid": "string"
}