リファレンス · ファイル
ファイル一覧を取得
GET
/v1/files
ユーザーがファイルを閲覧できる組織のファイルを、新しい順で一覧表示します。
ページ分割されたレスポンスです。項目はdataに、ページ情報はmetaに入ります。 ページネーションとフィルター
パラメーター
| 名前 | 型 | 説明 |
|---|---|---|
organization | string | 組織のuid。その組織の項目のみを返します(/organizationsを参照)。 |
q | string | 名前の一部(最大100文字)。 |
type | string | ファイルの種類(image、videoなど)。 |
archived | integer | 1でアーカイブ済みのファイルのみ、0でアーカイブされていないファイルのみを返します。指定しない場合は、すべてのファイルが返されます。 |
page | integer | ページ番号(1から)。デフォルト:1。 |
per_page | integer | 1ページあたりの項目数(1~100)。デフォルト:50。 |
各項目のフィールド
uidstring- ファイルの識別子。
namestring- コントロールパネルでのファイル名。
typestring- ファイルの種類(
image、videoなど)。 durationinteger- 再生時間(秒)。
archivedboolean- ファイルがアーカイブ済みの場合は
true。 organizationobject- ファイルが属する組織:
uidとname。
発生しうるエラー
- 400
invalid_parameterパラメーターの値が無効です(例:per_pageが上限を超えている)。 - 404
organization_not_found指定されたorganizationは、ユーザーがこの種類の項目を参照できる組織ではありません。 - キーとレート制限に関するエラーは、すべてのエンドポイントに共通です。 すべてのエラーを見る
リクエスト
curl "https://api.on-cloud.live/v1/files?per_page=2" \
-H "X-API-Key: $API_KEY"<?php
$ch = curl_init('https://api.on-cloud.live/v1/files?per_page=2');
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?per_page=2', {
headers: { 'X-API-Key': process.env.API_KEY }
});
const { data, meta } = await res.json();レスポンス200
{
"data": [
{
"uid": "c20ad4d76fe97759aa27a0c99bff6710",
"name": "Horário de funcionamento",
"type": "image",
"duration": 8,
"archived": false,
"organization": {
"uid": "1679091c5a880faf6fb5e6087eb1b2dc",
"name": "Loja Shopping Norte"
}
},
{
"uid": "6512bd43d9caa6e02c990b0a82652dca",
"name": "Cardápio do dia",
"type": "image",
"duration": 10,
"archived": false,
"organization": {
"uid": "8f14e45fceea167a5a36dedd4bea2543",
"name": "Loja Centro"
}
}
],
"meta": {
"page": 1,
"per_page": 2,
"total": 3,
"total_pages": 2
}
}