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
| Non | Tip | Deskripsyon |
|---|---|---|
uid | string | uid fichye a. |
Chan repons lan
uidstring- Idantifyan fichye a.
namestring- Non fichye a nan panèl la.
typestring- Tip fichye a, tankou
imageoswavideo. durationinteger- Dire, an segonn.
archivedbooleantruesi fichye a achive.organizationobject- Òganizasyon fichye a:
uidakname. sizeinteger- Gwosè fichye orijinal la, an byte.
widthinteger- Lajè fichye orijinal la, an piksèl.
heightinteger- Wotè fichye orijinal la, an piksèl.
aspect_ratiostring- Rapò ant lajè ak wotè, tankou
1.78. urlstring- Adrès fichye orijinal la, oswa yon tèks vid si li pa disponib.
scheduledbooleantruesi fichye a gen yon pwogramasyon ki aktif.playlistsarray- Playlist kote fichye a ye (
uid,nameakorganization). Se sèlman playlist itilizatè a ka wè yo ki parèt.
Erè ki posib
- 404
not_foundEndpoint 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."
}
}