레퍼런스 · 파일

파일 상세 조회

GET /v1/files/{uid}

uid로 파일 하나를 조회합니다. 크기, 해상도, 원본 파일의 URL, 파일이 포함된 재생목록도 함께 반환합니다.

경로 매개변수

이름타입설명
uidstring파일의 uid.

응답 필드

uid string
파일 식별자.
name string
관리 패널에 표시되는 파일 이름.
type string
파일 유형(예: image, video).
duration integer
재생 시간(초).
archived boolean
파일이 보관된 상태이면 true.
organization object
파일이 속한 회사: uid 및 name.
size integer
원본 파일 크기(바이트).
width integer
원본 파일 너비(픽셀).
height integer
원본 파일 높이(픽셀).
aspect_ratio string
너비와 높이의 비율(예: 1.78).
url string
원본 파일의 URL. 사용할 수 없으면 빈 문자열.
scheduled boolean
파일에 활성화된 일정이 있으면 true.
playlists array
파일이 포함된 재생목록(uid, name, organization). 사용자가 볼 수 있는 재생목록만 표시됩니다.

발생 가능한 오류

  • 404 not_found 엔드포인트가 존재하지 않거나, 항목이 존재하지 않거나, 사용자가 볼 수 없는 회사의 항목입니다.
  • 키 및 요청 한도 관련 오류는 모든 엔드포인트에 적용됩니다. 모든 오류 보기
요청
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();
응답200
{
  "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"
        }
      }
    ]
  }
}
존재하지 않거나 접근 권한이 없는 항목404
{
  "error": {
    "code": "not_found",
    "message": "Item not found or you do not have access to it."
  }
}