このコレクションに含まれるファイルやフォルダを取得します。
"926489"
コレクションのID。
id,type,name
レスポンスに含める属性のカンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。
1000
1000
返す項目の1ページあたりの最大数。
1000
0
レスポンスが開始される項目のオフセット。
オフセットパラメータ値が10,000を超えているクエリは拒否され、400レスポンスが返されます。
curl -i -X GET "https://api.box.com/2.0/collections/926489/items" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
BoxCollection<BoxItem> items = await client.CollectionsManager.GetCollectionItemsAsync(id: "11111");
BoxFolder folder = new BoxFolder(api, "id");
for (BoxItem.Info itemInfo : folder) {
if (itemInfo instanceof BoxFile.Info) {
BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
// Do something with the file.
} else if (itemInfo instanceof BoxFolder.Info) {
BoxFolder.Info folderInfo = (BoxFolder.Info) itemInfo;
// Do something with the folder.
}
}
items = client.collection(collection_id='12345').get_items()
for item in items:
print(f'{item.type.capitalize()} "{item.name}" is in the collection')
client.collections.getItems('81934', {fields: 'name', limit: 2})
.then(items => {
/* items -> { total_count: 24,
entries:
[ { type: 'folder',
id: '192429928',
sequence_id: '1',
etag: '1',
name: 'Stephen Curry Three Pointers' },
{ type: 'file',
id: '818853862',
sequence_id: '0',
etag: '0',
name: 'Warriors.jpg' } ],
offset: 0,
limit: 2 }
*/
});
{
"entries": [
{
"id": "12345",
"etag": "1",
"type": "file",
"sequence_id": "3",
"name": "Contract.pdf",
"sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
"file_version": {
"id": "12345",
"type": "file_version",
"sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
}
}
],
"limit": 1000,
"offset": 2000,
"order": [
{
"by": "type",
"direction": "ASC"
}
],
"total_count": 5000
}