Inkomba · Amafayela
Bonisa ifayela elilodwa
GET
/v1/files/{uid}
Ibonisa ifayela elilodwa ngokwe-uid yalo, kanye nosayizi, ukucaca, i-URL yefayela langempela nezinhlu zokudlala elikuzo.
Ipharamitha esendleleni
| Igama | Uhlobo | Incazelo |
|---|---|---|
uid | string | I-uid yefayela. |
Izinkambu zempendulo
uidstring- Isihlonzi sefayela.
namestring- Igama lefayela ephanelini yokulawula.
typestring- Uhlobo lwefayela, njenge-
imagenoma i-video. durationinteger- Ubude besikhathi, ngemizuzwana.
archivedbooleantrueuma ifayela ligciniwe.organizationobject- Inhlangano yefayela:
uidne-name. sizeinteger- Usayizi wefayela langempela, ngama-byte.
widthinteger- Ububanzi befayela langempela, ngamaphikseli.
heightinteger- Ubude befayela langempela, ngamaphikseli.
aspect_ratiostring- Isilinganiso phakathi kobubanzi nobude, njenge-
1.78. urlstring- I-URL yefayela langempela, noma umbhalo ongenalutho uma ingatholakali.
scheduledbooleantrueuma ifayela linesheduli esebenzayo.playlistsarray- Izinhlu zokudlala ifayela elikuzo (
uid,namene-organization). Kuvela kuphela izinhlu umsebenzisi angazibona.
Amaphutha angenzeka
- 404
not_foundI-endpoint ayikho, noma into ayikho noma ingeyenhlangano umsebenzisi angakwazi ukuyibona. - Amaphutha okhiye nawomkhawulo asebenza kuwo wonke ama-endpoint. Bona wonke amaphutha
Isicelo
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();Impendulo200
{
"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"
}
}
]
}
}Into engekho noma engenakufinyelela404
{
"error": {
"code": "not_found",
"message": "Item not found or you do not have access to it."
}
}