Referans · Fichye

Wè yon fichye

GET /v1/files/{uid}

Montre yon fichye dapre uid li, ak gwosè li, rezolisyon li, adrès fichye orijinal la ak playlist kote li ye yo.

Paramèt nan adrès la

NonTipDeskripsyon
uidstringuid fichye a.

Chan repons lan

uid string
Idantifyan fichye a.
name string
Non fichye a nan panèl la.
type string
Tip fichye a, tankou image oswa video.
duration integer
Dire, an segonn.
archived boolean
true si fichye a achive.
organization object
Òganizasyon fichye a: uid ak name.
size integer
Gwosè fichye orijinal la, an byte.
width integer
Lajè fichye orijinal la, an piksèl.
height integer
Wotè fichye orijinal la, an piksèl.
aspect_ratio string
Rapò ant lajè ak wotè, tankou 1.78.
url string
Adrès fichye orijinal la, oswa yon tèks vid si li pa disponib.
scheduled boolean
true si fichye a gen yon pwogramasyon ki aktif.
playlists array
Playlist kote fichye a ye (uid, name ak organization). Se sèlman playlist itilizatè a ka wè yo ki parèt.

Erè ki posib

  • 404 not_found Endpoint la pa egziste, oswa eleman an pa egziste oswa li fè pati yon òganizasyon itilizatè a pa ka wè.
  • Erè kle ak erè limit yo aplike pou tout endpoint yo. Wè tout erè yo
Demann
curl "https://api.on-cloud.live/v1/files/a87ff679a2f3e71d9181a67b7542122c" \
  -H "X-API-Key: $API_KEY"
<?php
$ch = curl_init('https://api.on-cloud.live/v1/files/a87ff679a2f3e71d9181a67b7542122c');
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/files/a87ff679a2f3e71d9181a67b7542122c', {
  headers: { 'X-API-Key': process.env.API_KEY }
});
const { data } = await res.json();
Repons200
{
  "data": {
    "uid": "a87ff679a2f3e71d9181a67b7542122c",
    "name": "Promoção de verão",
    "type": "video",
    "duration": 30,
    "archived": false,
    "organization": {
      "uid": "8f14e45fceea167a5a36dedd4bea2543",
      "name": "Loja Centro"
    },
    "size": 18734520,
    "width": 1920,
    "height": 1080,
    "aspect_ratio": "1.78",
    "url": "https://oncloud.bunny.files.on-cloud.live/files/a87ff679a2f3e71d9181a67b7542122c-1.mp4",
    "scheduled": true,
    "playlists": [
      {
        "uid": "e4da3b7fbbce2345d7772b0674a318d5",
        "name": "Lista principal",
        "organization": {
          "uid": "8f14e45fceea167a5a36dedd4bea2543",
          "name": "Loja Centro"
        }
      }
    ]
  }
}
Eleman ki pa egziste oswa san aksè404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}