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
| Pangalan | Uri | Paglalarawan |
|---|---|---|
uid | string | uid ng file. |
Mga field ng response
uidstring- Identifier ng file.
namestring- Pangalan ng file sa control panel.
typestring- Uri ng file, gaya ng
imageovideo. durationinteger- Tagal, sa segundo.
archivedbooleantruekung naka-archive ang file.organizationobject- Organisasyon ng file:
uidatname. sizeinteger- Laki ng orihinal na file, sa bytes.
widthinteger- Lapad ng orihinal na file, sa pixels.
heightinteger- Taas ng orihinal na file, sa pixels.
aspect_ratiostring- Proporsyon ng lapad at taas, gaya ng
1.78. urlstring- URL ng orihinal na file, o walang lamang text kung hindi ito available.
scheduledbooleantruekung may aktibong iskedyul ang file.playlistsarray- Mga playlist kung saan kasama ang file (
uid,nameatorganization). Ang mga playlist lang na nakikita ng user ang lumalabas.
Mga posibleng error
- 404
not_foundHindi 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."
}
}