参考 · 播放列表

列出播放列表

GET /v1/playlists

按字母顺序列出用户有权查看播放列表的组织中的播放列表。

分页响应:项目位于 data 中,分页信息位于 meta 中。 分页和筛选

参数

名称类型说明
organizationstring组织的 uid,用于只返回该组织的项目(参见 /organizations)。
qstring名称中的部分文字,最多 100 个字符。
pageinteger页码,从 1 开始。默认值:1。
per_pageinteger每页项目数,范围为 1 到 100。默认值:50。

每个项目的字段

uid string
播放列表标识符。
name string
播放列表名称。
organization object
播放列表所属的组织:uid 和 name。
total_time integer
播放列表的总时长,单位为秒。
total_time_is_approximate boolean
如果总时长为估算值,则为 true。

可能的错误

  • 400 invalid_parameter 某个参数的值无效,例如 per_page 超过最大值。
  • 404 organization_not_found 传入的 organization 不是该用户可以查看此类项目的组织。
  • 密钥错误和频率限制错误适用于所有端点。 查看所有错误
请求
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();
响应200
{
  "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
  }
}