Reference · Playlists
List playlists
GET
/v1/playlists
Lists the playlists of the organizations where the user can see playlists, in alphabetical order.
Paginated response: items come in data and the page information in meta. Pagination and filters
Parameters
| Name | Type | Description |
|---|---|---|
organization | string | uid of an organization, to return only its items (see /organizations). |
q | string | Part of the name, up to 100 characters. |
page | integer | Page, starting at 1. Default: 1. |
per_page | integer | Items per page, from 1 to 100. Default: 50. |
Fields of each item
uidstring- Playlist identifier.
namestring- Playlist name.
organizationobject- Organization of the playlist:
uidandname. total_timeinteger- Total playlist time, in seconds.
total_time_is_approximatebooleantrueif the total time is an estimate.
Possible errors
- 400
invalid_parameterA parameter has an invalid value, such asper_pageabove the maximum. - 404
organization_not_foundTheorganizationgiven is not an organization where the user can see this type of item. - Key and rate limit errors apply to every endpoint. See all errors
Request
curl "https://api.on-cloud.live/v1/playlists?per_page=2" \
-H "X-API-Key: $API_KEY"<?php
$ch = curl_init('https://api.on-cloud.live/v1/playlists?per_page=2');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('API_KEY')],
]);
$response = json_decode(curl_exec($ch), true);const res = await fetch('https://api.on-cloud.live/v1/playlists?per_page=2', {
headers: { 'X-API-Key': process.env.API_KEY }
});
const { data, meta } = await res.json();Response200
{
"data": [
{
"uid": "1f0e3dad99908345f7439f8ffabdffc4",
"name": "Lista do caixa",
"organization": {
"uid": "1679091c5a880faf6fb5e6087eb1b2dc",
"name": "Loja Shopping Norte"
},
"total_time": 40,
"total_time_is_approximate": false
},
{
"uid": "e4da3b7fbbce2345d7772b0674a318d5",
"name": "Lista principal",
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
},
"total_time": 85,
"total_time_is_approximate": true
}
],
"meta": {
"page": 1,
"per_page": 2,
"total": 2,
"total_pages": 1
}
}