Media Files
| Method | get.media_files |
|---|---|
| Description | Retrieves a list of media files |
| Who has access | Agents and clients |
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
access_token |
string | yes | Session key used to authenticate the request |
user_id |
number | no | Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call "get.customer_users". |
limit |
number | no | Maximum number of records to return. See the "Paging" section. |
offset |
number | no | Number of records to skip before returning results. Default: 0. See the "Paging" section. |
filter |
object | no | Filtering criteria. See the "Filters" section. |
fields |
array | no | Fields to include in the response. See the "Viewing returned data" section. |
sort |
array | no | Sorting criteria. See the "Data sorting" section. |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Description |
|---|---|---|---|---|---|
id |
number | yes | yes | Unique ID of the media file | |
name |
string | yes | yes | Media file name. Unique within the client account. | |
duration |
number | yes | yes | Media file duration, in seconds | |
play_link |
string | URL for playing the media file | |||
normalization |
boolean | yes | yes | Indicates whether the media file has been normalized | |
size |
number | yes | yes | Media file size, in bytes | |
type |
enum |
| yes | yes | Media file type: system — System media file; cannot be edited. user — Custom media file. |
Example request
{
"jsonrpc": "2.0",
"id": "number",
"method": "get.media_files",
"params": {
"access_token": "string",
"user_id": "number",
"offset": "number",
"limit": "number",
"filter": {},
"sort": [
{"field": "string", "order": "string"}
],
"fields": ["string"]
}
}
Example response
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {},
"data": [
{
"id": "number",
"name": "string",
"duration": "number",
"play_link": "string",
"normalization": "boolean",
"size": "number",
"type": "enum"
}
]
}
}
List of returned errors
See the "List of errors for get methods" section.