フォルダ内の最初の100エントリを含むフォルダの詳細を取得します。
フォルダ内の項目をさらに多く取得するには、フォルダ内の項目を取得エンドポイントを使用してください。
12345
フォルダを表す一意の識別子。
フォルダIDを確認するには、ウェブアプリケーションでこのフォルダにアクセスして、URLからIDをコピーします。たとえば、URLがhttps://*.app.box.com/folder/123
の場合、folder_id
は123
です。
Boxアカウントのルートフォルダは常にID 0
で表されます。
id,type,name
レスポンスに含める属性のカンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。
また、このフィールドを使用すると、ファイルに適用されている任意のメタデータに対してクエリを実行できます。その際、metadata
フィールドのほか、取得するテンプレートのスコープとキー (例: ?field=metadata.enterprise_12345.contractTemplate
) も指定します。
shared_link=[link]&shared_link_password=[password]
この項目の共有リンクのURLと省略可能なパスワード。
このヘッダーを使用すると、ユーザーと明示的に共有されていない項目にアクセスできます。
shared_link=[link]
形式を使用するか、パスワードが必要な場合はshared_link=[link]&shared_link_password=[password]
を使用します。
このヘッダーは、共有されているファイルまたはフォルダのほか、その項目内にネストされているすべてのファイルやフォルダで使用できます。
1
項目が変更されている場合にのみ、その項目を返します。
その項目の最後に認識されたetag
値をこのヘッダーに渡すと、それ以降に項目が変更されていない場合、エンドポイントは304 Not Modified
を返して失敗します。
フォルダ内の最初の100エントリを含め、フォルダを返します。
フォルダ内の項目をさらに多く取得するには、フォルダ内の項目を取得エンドポイントを使用してください。
使用可能なすべてのフィールドがデフォルトで返されるとは限りません。特定のフィールドを明示的にリクエストするには、fieldsクエリパラメータを使用します。
If-None-Match
ヘッダーがフォルダの現在のetag
値と一致する場合は、空のレスポンスを返します。これは、フォルダが前回リクエストされたときから変更されていないことを示します。
Authorization
ヘッダーで指定されているアクセストークンが認識されないか、指定されていない場合に返されます。
フォルダが見つからない場合、またはユーザーにフォルダへのアクセス権限が与えられていない場合に返されます。
folder_id
が認識されていない形式で指定されている場合に返されます。
予期しないクライアントエラー。
curl -i -X GET "https://api.box.com/2.0/folders/4353455" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
BoxFolder folder = await client.FoldersManager.GetInformationAsync("11111");
BoxFolder folder = new BoxFolder(api, "id");
BoxFolder.Info info = folder.getInfo();
folder = client.folder(folder_id='22222').get()
print(f'Folder "{folder.name}" has {folder.item_collection["total_count"]} items in it')
client.folders.get('11111')
.then(folder => {
/* folder -> {
type: 'folder',
id: '11111',
sequence_id: '1',
etag: '1',
name: 'Pictures',
created_at: '2012-12-12T10:53:43-08:00',
modified_at: '2012-12-12T11:15:04-08:00',
description: 'Some pictures I took',
size: 629644,
path_collection:
{ total_count: 1,
entries:
[ { type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' } ] },
created_by:
{ type: 'user',
id: '22222',
name: 'Example User'
login: 'user@example.com' },
modified_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
owned_by:
{ type: 'user',
id: '22222',
name: 'Example User',
login: 'user@example.com' },
shared_link: null,
parent:
{ type: 'folder',
id: '0',
sequence_id: null,
etag: null,
name: 'All Files' },
item_status: 'active',
item_collection:
{ total_count: 1,
entries:
[ { type: 'file',
id: '33333',
sequence_id: '3',
etag: '3',
sha1: '134b65991ed521fcfe4724b7d814ab8ded5185dc',
name: 'tigers.jpeg' } ],
offset: 0,
limit: 100 } }
*/
});
client.folders.get(
folderId: "22222",
fields: ["name", "created_at"]
) { (result: Result<Folder, BoxSDKError>) in
guard case let .success(folder) = result else {
print("Error getting folder information")
return
}
print("Folder \(folder.name) was created at \(folder.createdAt)")
}
{
"id": 12345,
"type": "folder",
"content_created_at": "2012-12-12T10:53:43-08:00",
"content_modified_at": "2012-12-12T10:53:43-08:00",
"created_at": "2012-12-12T10:53:43-08:00",
"created_by": {
"id": 11446498,
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"description": "Legal contracts for the new ACME deal",
"etag": 1,
"folder_upload_email": {
"access": "open",
"email": "upload.Contracts.asd7asd@u.box.com"
},
"item_collection": {
"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
},
"item_status": "active",
"modified_at": "2012-12-12T10:53:43-08:00",
"modified_by": {
"id": 11446498,
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"name": "Contracts",
"owned_by": {
"id": 11446498,
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"parent": {
"id": 12345,
"type": "folder",
"etag": 1,
"name": "Contracts",
"sequence_id": 3
},
"path_collection": {
"entries": [
{
"id": 12345,
"etag": 1,
"type": "folder",
"sequence_id": 3,
"name": "Contracts"
}
],
"total_count": 1
},
"purged_at": "2012-12-12T10:53:43-08:00",
"sequence_id": 3,
"shared_link": {
"access": "open",
"download_count": 3,
"download_url": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg",
"effective_access": "company",
"effective_permission": "can_download",
"is_password_enabled": true,
"permissions": {
"can_download": true,
"can_edit": false,
"can_preview": true
},
"preview_count": 3,
"unshared_at": "2018-04-13T13:53:23-07:00",
"url": "https://www.box.com/s/vspke7y05sb214wjokpk",
"vanity_name": "my_url",
"vanity_url": "https://acme.app.box.com/v/my_url/"
},
"size": 629644,
"trashed_at": "2012-12-12T10:53:43-08:00"
}