Retrieves a page of items in a folder. These items can be files, folders, and web links.
To request more information about the folder itself, like its size, please use the Get a folder endpoint instead.
0
The unique identifier that represent a folder.
The ID for any folder can be determined
by visiting this folder in the web application
and copying the ID from the URL. For example,
for the URL https://*.app.box.com/folder/123
the folder_id
is 123
.
The root folder of a Box account is
always represented by the ID 0
.
ASC
The direction to sort results in. This can be either in alphabetical ascending
(ASC
) or descending (DESC
) order.
Value is one of ASC
,DESC
id,type,name
A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
1000
1000
The maximum number of items to return per page.
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.
This requires usemarker
to be set to true
.
1000
0
The offset of the item at which to begin the response.
id
Defines the second attribute by which items are sorted.
Items are always sorted by their type
first, with
folders listed before files, and files listed
before web links.
This parameter is not supported for marker-based pagination
on the root folder (the folder with an ID of 0
).
Value is one of id
,name
,date
,size
true
Specifies whether to use marker-based pagination instead of offset-based pagination. Only one pagination method can be used at a time.
By setting this value to true, the API will return a marker
field
that can be passed as a parameter to this endpoint to get the next
page of the response.
Returns a collection of files, folders, and web links contained in a folder.
Returned when the access token provided in the Authorization
header
is not recognized or not provided.
Returned if the folder is not found, or the user does not have access to the folder.
Returned if the folder_id
is not in a recognized format.
An unexpected client error.
curl -X GET https://api.box.com/2.0/folders/0/items \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxCollection<BoxItem> folderItems = await client.FoldersManager.GetFolderItemsAsync("11111", 100);
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.folder(folder_id='22222').get_items()
for item in items:
print('{0} {1} is named "{2}"'.format(item.type.capitalize(), item.id, item.name))
client.folders.getItems(
'12345',
{
usemarker: 'false',
fields: 'name',
offset: 0,
limit: 25
})
.then(items => {
/* items -> {
total_count: 2,
entries:
[ { type: 'folder',
id: '11111',
sequence_id: '1',
etag: '1',
name: 'Personal Documents' },
{ type: 'file',
id: '22222',
sequence_id: '0',
etag: '0',
name: 'Q2 Strategy.pptx' } ],
offset: 0,
limit: 25,
order:
[ { by: 'type', direction: 'ASC' },
{ by: 'name', direction: 'ASC' } ] }
*/
});
let folderItems = client.folders.listItems(folderId: "22222", sort: .name, direction: .ascending) { results in
switch results {
case let .success(iterator):
for i in 1 ... 10 {
iterator.next { result in
switch result {
case let .success(item):
switch item {
case let .file(file):
print("File \(file.name) (ID: \(file.id)) is in the folder")
case let .folder(folder):
print("Subfolder \(folder.name) (ID: \(folder.id)) is in the folder")
case let .webLink(webLink):
print("Web link \(webLink.name) (ID: \(webLink.id)) is in the folder")
}
case let .failure(error):
print(error)
}
}
}
case let .failure(error):
print(error)
}
}