ข้อมูลอ้างอิง · เพลย์ลิสต์

ดูข้อมูลเพลย์ลิสต์

GET /v1/playlists/{uid}

แสดงเพลย์ลิสต์หนึ่งรายการตาม uid พร้อมรายการต่าง ๆ ตามลำดับการแสดงผล และทีวีที่ใช้เพลย์ลิสต์นี้

พารามิเตอร์ในพาธ

ชื่อประเภทคำอธิบาย
uidstringuid ของเพลย์ลิสต์

ฟิลด์ของการตอบกลับ

uid string
ตัวระบุเพลย์ลิสต์
name string
ชื่อเพลย์ลิสต์
organization object
องค์กรของเพลย์ลิสต์: uid และ name
total_time integer
เวลารวมของเพลย์ลิสต์ หน่วยเป็นวินาที
total_time_is_approximate boolean
true หากเวลารวมเป็นค่าประมาณ
items array
รายการในเพลย์ลิสต์ ตามลำดับการแสดงผล
items[].position integer
ตำแหน่งของรายการในเพลย์ลิสต์
items[].type string
file สำหรับไฟล์ หรือ entertainment สำหรับเนื้อหาความบันเทิง อาจมีประเภทอื่นปรากฏด้วย
items[].uid string
ตัวระบุของไฟล์หรือเนื้อหาความบันเทิง
items[].display_time integer | null
เวลาแสดงผลที่ตั้งไว้ในรายการ หน่วยเป็นวินาที หรือ null หากไม่ได้ตั้งไว้
items[].file object | null
ข้อมูลไฟล์ ซึ่งมีฟิลด์เดียวกับใน “แสดงรายการไฟล์” หรือ null หากรายการนั้นไม่ใช่ไฟล์ หรือผู้ใช้ไม่มีสิทธิ์ดูไฟล์ขององค์กรนั้น
tvs array
ทีวีที่ใช้เพลย์ลิสต์นี้ (uid, name และ organization) แสดงเฉพาะทีวีที่ผู้ใช้มีสิทธิ์ดู

ข้อผิดพลาดที่อาจเกิดขึ้น

  • 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."
  }
}