参考 · 电视

查看电视

GET /v1/tvs/{uid}

按 uid 返回一台电视。

路径参数

名称类型说明
uidstring电视的 uid。

响应字段

uid string
电视标识符,与控制面板中使用的相同。
name string
电视名称。
description string
电视描述(可能为空)。
organization object
电视所属的组织:uid 和 name。
playlist object | null
电视的播放列表(uid 和 name);如果没有,则为 null。
status string
online、alert 或 offline,说明见下文。
last_seen_at string | null
电视最近一次与平台通信的时间;如果从未连接过,则为 null。
activated_at string | null
电视的激活时间。
app_version string
电视上安装的应用版本。
os string
电视的操作系统,例如 android。
device object
设备品牌(brand)和型号(model),在电视上报时提供。
timezone string | null
电视的时区,例如 America/Sao_Paulo,或 null。

状态的计算方式

  • online 3 分钟内有通信,正在播放
  • alert 最近一次通信在 3 到 9 分钟前,或电视仍在启动
  • offline 10 分钟或更长时间无通信,或从未连接过

与控制面板中状态颜色的规则相同。

可能的错误

  • 404 not_found 端点不存在,或者项目不存在,或者项目属于该用户无权查看的组织。
  • 密钥错误和频率限制错误适用于所有端点。 查看所有错误
请求
curl "https://api.on-cloud.live/v1/tvs/c98cb8f9cc62887d1f6cf5693df9219c" \
  -H "X-API-Key: $API_KEY"
<?php
$ch = curl_init('https://api.on-cloud.live/v1/tvs/c98cb8f9cc62887d1f6cf5693df9219c');
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/tvs/c98cb8f9cc62887d1f6cf5693df9219c', {
  headers: { 'X-API-Key': process.env.API_KEY }
});
const { data } = await res.json();
响应200
{
  "data": {
    "uid": "c98cb8f9cc62887d1f6cf5693df9219c",
    "name": "Recepção",
    "description": "TV da entrada",
    "organization": {
      "uid": "8f14e45fceea167a5a36dedd4bea2543",
      "name": "Loja Centro"
    },
    "playlist": {
      "uid": "e4da3b7fbbce2345d7772b0674a318d5",
      "name": "Lista principal"
    },
    "status": "online",
    "last_seen_at": "2026-11-03T14:32:10-03:00",
    "activated_at": "2025-03-12T09:41:05-03:00",
    "app_version": "3.12.84",
    "os": "android",
    "device": {
      "brand": "TCL",
      "model": "43P635"
    },
    "timezone": "America/Sao_Paulo"
  }
}
项目不存在或无权访问404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}