Referència · Fitxers

Veure un fitxer

GET /v1/files/{uid}

Retorna un fitxer a partir del seu uid, amb la mida, la resolució, l'URL del fitxer original i les llistes de reproducció en què figura.

Paràmetre de ruta

NomTipusDescripció
uidstringuid del fitxer.

Camps de la resposta

uid string
Identificador del fitxer.
name string
Nom del fitxer al tauler.
type string
Tipus de fitxer, com ara image o video.
duration integer
Durada, en segons.
archived boolean
true si el fitxer està arxivat.
organization object
Organització del fitxer: uid i name.
size integer
Mida del fitxer original, en bytes.
width integer
Amplada del fitxer original, en píxels.
height integer
Alçada del fitxer original, en píxels.
aspect_ratio string
Relació entre l'amplada i l'alçada, com ara 1.78.
url string
URL del fitxer original, o un text buit si no està disponible.
scheduled boolean
true si el fitxer té una programació activa.
playlists array
Llistes de reproducció en què figura el fitxer (uid, name i organization). Només hi apareixen les llistes que l'usuari pot veure.

Errors possibles

  • 404 not_found L'endpoint no existeix, o bé l'element no existeix o pertany a una organització que l'usuari no pot veure.
  • Els errors de clau i de límit s'apliquen a tots els endpoints. Veure tots els errors
Sol·licitud
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();
Resposta200
{
  "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"
        }
      }
    ]
  }
}
Element inexistent o sense accés404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}