Referència · Llistes de reproducció
Veure una llista
GET
/v1/playlists/{uid}
Retorna una llista de reproducció a partir del seu uid, amb els elements en ordre de reproducció i les TV que la utilitzen.
Paràmetre de ruta
| Nom | Tipus | Descripció |
|---|---|---|
uid | string | uid de la llista de reproducció. |
Camps de la resposta
uidstring- Identificador de la llista de reproducció.
namestring- Nom de la llista.
organizationobject- Organització de la llista:
uidiname. total_timeinteger- Durada total de la llista, en segons.
total_time_is_approximatebooleantruesi la durada total és una estimació.itemsarray- Elements de la llista, en ordre de reproducció.
items[].positioninteger- Posició de l'element a la llista.
items[].typestringfileper a un fitxer oentertainmentper a un contingut d'entreteniment. Poden aparèixer altres tipus.items[].uidstring- Identificador del fitxer o del contingut d'entreteniment.
items[].display_timeinteger | null- Temps de reproducció definit a l'element, en segons, o
nullsi no en té. items[].fileobject | null- Dades del fitxer, amb els mateixos camps que a «Llistar fitxers», o
nullsi l'element no és un fitxer o si l'usuari no pot veure els fitxers de la seva organització. tvsarray- TV que utilitzen la llista (
uid,nameiorganization). Només hi apareixen les TV que l'usuari pot veure.
Errors possibles
- 404
not_foundL'endpoint no existeix, o bé l'element no existeix o pertany a una organització que l'usuari no pot veure. - Els errors de clau i de límit s'apliquen a tots els endpoints. Veure tots els errors
Sol·licitud
curl "https://api.on-cloud.live/v1/playlists/e4da3b7fbbce2345d7772b0674a318d5" \
-H "X-API-Key: $API_KEY"<?php
$ch = curl_init('https://api.on-cloud.live/v1/playlists/e4da3b7fbbce2345d7772b0674a318d5');
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/e4da3b7fbbce2345d7772b0674a318d5', {
headers: { 'X-API-Key': process.env.API_KEY }
});
const { data } = await res.json();Resposta200
{
"data": {
"uid": "e4da3b7fbbce2345d7772b0674a318d5",
"name": "Lista principal",
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
},
"total_time": 85,
"total_time_is_approximate": true,
"items": [
{
"position": 1,
"type": "file",
"uid": "a87ff679a2f3e71d9181a67b7542122c",
"display_time": null,
"file": {
"uid": "a87ff679a2f3e71d9181a67b7542122c",
"name": "Promoção de verão",
"type": "video",
"duration": 30,
"archived": false,
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
}
}
},
{
"position": 2,
"type": "entertainment",
"uid": "noticias",
"display_time": 15,
"file": null
},
{
"position": 3,
"type": "file",
"uid": "6512bd43d9caa6e02c990b0a82652dca",
"display_time": 10,
"file": {
"uid": "6512bd43d9caa6e02c990b0a82652dca",
"name": "Cardápio do dia",
"type": "image",
"duration": 10,
"archived": false,
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
}
}
}
],
"tvs": [
{
"uid": "c98cb8f9cc62887d1f6cf5693df9219c",
"name": "Recepção",
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
}
},
{
"uid": "45c48cce2e2d7fbdea1afc51c7c6ad26",
"name": "Vitrine",
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
}
}
]
}
}Element inexistent o sense accés404
{
"error": {
"code": "not_found",
"message": "Item not found or you do not have access to it."
}
}