Sanggunian · Mga TV

Tingnan ang isang TV

GET /v1/tvs/{uid}

Ipinapakita ang isang TV ayon sa uid nito.

Parameter sa path

PangalanUriPaglalarawan
uidstringuid ng TV.

Mga field ng response

uid string
Identifier ng TV, ang parehong ginagamit sa control panel.
name string
Pangalan ng TV.
description string
Paglalarawan ng TV (puwedeng walang laman).
organization object
Organisasyon ng TV: uid at name.
playlist object | null
Playlist ng TV (uid at name), o null kung wala.
status string
online, alert o offline, gaya ng ipinaliwanag sa ibaba.
last_seen_at string | null
Huling contact ng TV sa platform, o null kung hindi pa ito kailanman nakakonekta.
activated_at string | null
Kailan na-activate ang TV.
app_version string
Bersyon ng app na naka-install sa TV.
os string
Operating system ng TV, gaya ng android.
device object
Brand (brand) at modelo (model) ng device, kapag iniuulat ito ng TV.
timezone string | null
Time zone ng TV, gaya ng America/Sao_Paulo, o null.

Paano kinakalkula ang status

  • online may contact sa nakalipas na wala pang 3 minuto, nagpe-play
  • alert huling contact 3 hanggang 9 minuto na ang nakalipas, o nagsisimula pa ang TV
  • offline walang contact sa loob ng 10 minuto o higit pa, o hindi pa kailanman nakakonekta

Ito rin ang patakaran ng mga kulay ng status sa control panel.

Mga posibleng error

  • 404 not_found Hindi umiiral ang endpoint, o hindi umiiral ang item o kabilang ito sa isang organisasyong hindi nakikita ng user.
  • Umiiral sa lahat ng endpoint ang mga error sa key at sa limitasyon. Tingnan ang lahat ng error
Request
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();
Response200
{
  "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"
  }
}
Item na hindi umiiral o walang access404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}