Sanggunian · Mga File

Tingnan ang isang file

GET /v1/files/{uid}

Ipinapakita ang isang file ayon sa uid nito, kasama ang laki, resolution, URL ng orihinal na file at ang mga playlist kung saan ito kasama.

Parameter sa path

PangalanUriPaglalarawan
uidstringuid ng file.

Mga field ng response

uid string
Identifier ng file.
name string
Pangalan ng file sa control panel.
type string
Uri ng file, gaya ng image o video.
duration integer
Tagal, sa segundo.
archived boolean
true kung naka-archive ang file.
organization object
Organisasyon ng file: uid at name.
size integer
Laki ng orihinal na file, sa bytes.
width integer
Lapad ng orihinal na file, sa pixels.
height integer
Taas ng orihinal na file, sa pixels.
aspect_ratio string
Proporsyon ng lapad at taas, gaya ng 1.78.
url string
URL ng orihinal na file, o walang lamang text kung hindi ito available.
scheduled boolean
true kung may aktibong iskedyul ang file.
playlists array
Mga playlist kung saan kasama ang file (uid, name at organization). Ang mga playlist lang na nakikita ng user ang lumalabas.

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/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();
Response200
{
  "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"
        }
      }
    ]
  }
}
Item na hindi umiiral o walang access404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}