リファレンス · プレイリスト
プレイリストを取得
GET
/v1/playlists/{uid}
uidを指定して、プレイリストを1件取得します。再生順に並んだ項目と、そのプレイリストを使用しているTVも返されます。
パスパラメーター
| 名前 | 型 | 説明 |
|---|---|---|
uid | string | プレイリストのuid。 |
レスポンスのフィールド
uidstring- プレイリストの識別子。
namestring- プレイリスト名。
organizationobject- プレイリストが属する組織:
uidとname。 total_timeinteger- プレイリストの合計時間(秒)。
total_time_is_approximateboolean- 合計時間が概算の場合は
true。 itemsarray- プレイリストの項目(再生順)。
items[].positioninteger- プレイリスト内での項目の位置。
items[].typestring- ファイルの場合は
file、エンターテインメントコンテンツの場合はentertainment。その他の種類が返されることもあります。 items[].uidstring- ファイルまたはエンターテインメントコンテンツの識別子。
items[].display_timeinteger | null- 項目に設定された表示時間(秒)。設定がない場合は
null。 items[].fileobject | null- ファイルの情報(「ファイル一覧を取得」と同じフィールド)。項目がファイルでない場合や、ユーザーがその項目の組織のファイルを閲覧できない場合は
null。 tvsarray- そのプレイリストを使用しているTV(
uid、name、organization)。ユーザーが参照できるTVのみが表示されます。
発生しうるエラー
- 404
not_foundエンドポイントが存在しないか、項目が存在しないか、ユーザーが参照できない組織の項目です。 - キーとレート制限に関するエラーは、すべてのエンドポイントに共通です。 すべてのエラーを見る
リクエスト
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();レスポンス200
{
"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"
}
}
]
}
}存在しない、またはアクセス権のない項目404
{
"error": {
"code": "not_found",
"message": "Item not found or you do not have access to it."
}
}