Get Specific Folder Contents
/documents/api/1.1/folders/{folderId}/items
Get a collection of child items (folders and files) in the specified folder. The type field indicates whether an item is a folder or a file.
Request
- application/json
- application/xml
- folderId
-
Type:
stringRequired:trueGlobally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for
folderIdisself.
- filterName
-
Type:
stringFilter the results to only those folders and files whose name matches the specified string exactly. If there is no exact match, the call returns an empty list. For example, the following parameter restricts the response to folders (or files) named
TestFolder:filterName=TestFolder
The filter changes the behavior of the following response parameters:
- count: The number of items that match the
filterNameparameter. - totalResults: The number of items that match the
filterNameparameter.
- count: The number of items that match the
- limit
-
Type:
stringSpecify the maximum number of items to return. Use this parameter to specify how many items to include on a single page of results. The default is
50. The following example limits the number of returned items to 10:limit=10
- offset
-
Type:
stringSpecify the point at which to begin the list of items from the complete set of items returned for the action. If you do not specify an offset, the returned items begin with the first item in the item list (
offset=0).Use this parameter to specify the starting point for a given page of results from the complete set of returned items. The following example limits the number of items per page to 10 and displays the second page of results (items 11-20):
limit=10&offset=10
- orderby
-
Type:
stringOrder the resulting items using the specified field and sort order. You can use the
name,createdTime, andmodifiedTimefields, and a sort order of ascending (asc) or descending (desc). For example, this is the default:orderby=name:asc
- accessToken
-
Type:
stringApplink access token authorizing the current user to access this folder. This parameter is mandatory if
appLinkIDis used. It can be used as accessToken or AccessToken. - appLinkID
-
Type:
stringApplink ID authorizing the current user to access this folder. Any time the parameter
appLinkIDis used, a parameteraccessTokenmust be provided as well. It can be used as appLinkID or AppLinkID. - dAccessCode
-
Type:
stringAccess code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format:
dAccessCode-<linkID>=<passcodeValue> - linkID
-
Type:
stringPublic link ID of a public link authorizing the current user to access this folder. It can be used as linkID or LinkID.
Response
- application/json
- application/xml
The request was fulfilled.
- childitemsCount
-
Type:
stringNumber of items contained in the folder. - count
-
Type:
stringThe number of items listed on the page. - createdBy
-
Type:
objectUserAdditional Properties Allowed:User information - createdTime
-
Type:
stringDate the folder was created. - description
-
Type:
stringFolder description. - errorCode
-
Type:
stringAn error code of zero (0) indicates no errors. - hasMore
-
Type:
stringThe number of users found. - id
-
Type:
stringGlobally unique identifier (GUID) for the folder. - items
-
Type:
arrayitemsAdditional Properties Allowed:The files and subfolders in the folder. - modifiedBy
-
Type:
objectUserAdditional Properties Allowed:User information - modifiedTime
-
Type:
stringDate the folder was last modified. - name
-
Type:
stringFolder name. - ownedBy
-
Type:
objectUserAdditional Properties Allowed:User information - parentID
-
Type:
stringGlobally unique identifier (GUID) for the parent folder. If the parent folder is the user's home folder, the value for
parentIDisself. - size
-
Type:
stringSize of the folder in bytes, including all of the files and folders contained in the folder. - totalResults
-
Type:
stringTotal number of items in the response. - type
-
Type:
stringItem typefolder.
- displayName
-
Type:
stringThe display name for the user. - id
-
Type:
stringGlobally unique identifier (GUID) for the user. - type
-
Type:
stringItem typeuser.
arrayobject0Example application/json
{
"count":"2",
"totalResults":"2",
"hasMore":"0",
"errorCode":"0",
"id":"FF4729683CD68C1AFB1AE87DT0000000000100000001",
"parentID":"self",
"name":"foldera",
"description":"rest folder",
"type":"folder",
"size":"39",
"childItemsCount":"2",
"createdTime":"2014-02-21T20:52:37Z",
"modifiedTime":"2014-02-21T20:52:37Z",
"createdBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"modifiedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"items":[
{
"id":"FB4CD874EF94CD2CC1B60B72T0000000000100000001",
"parentID":"FF4729683CD68C1AFB1AE87DT0000000000100000001",
"name":"restFolder",
"type":"folder",
"size":"39",
"childItemsCount":"1",
"createdTime":"2014-02-21T20:54:50Z",
"modifiedTime":"2014-02-21T20:54:50Z",
"createdBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"modifiedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
}
},
{
"id":"DB1C5AF480FFE61C588027A8T0000000000100000001",
"parentID":"FF4729683CD68C1AFB1AE87DT0000000000100000001",
"name":"example.txt",
"type":"file",
"size":"13",
"version":"1",
"createdTime":"2014-02-21T21:32:37Z",
"modifiedTime":"2014-02-21T21:32:37Z",
"createdBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"modifiedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
}
}
]
}
Request parameters are not formatted correctly.
Forbidden if the user does not have read permission.
Folder ID is not found.
Examples
The following example returns the list of child items in the specified folder.
GET .../folders/FF4729683CD68C1AFB1AE87DT0000000000100000001/items?orderby=name:asc&limit=2&offset=1
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"childItemsCount": "2",
"count": "2",
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdTime": "2014-02-21T20:52:37Z",
"errorCode": "0",
"hasMore": "0",
"id": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
"modifiedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedTime": "2014-02-21T20:52:37Z",
"name": "foldera",
"ownedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"parentID": "self",
"size": "39",
"totalResults": "2",
"type": "folder",
"items": [
{
"type": "folder",
"id": "FB4CD874EF94CD2CC1B60B72T0000000000100000001",
"parentID": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
"name": "restFolder",
"ownedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdTime": "2014-02-21T20:54:50Z",
"modifiedTime": "2014-02-21T20:54:50Z",
"description": "rest folder",
"size": "39",
"childItemsCount": "1"
},
{
"type": "file",
"id": "DB1C5AF480FFE61C588027A8T0000000000100000001",
"parentID": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
"name": "example.txt",
"ownedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdTime": "2014-02-21T21:32:37Z",
"modifiedTime": "2014-02-21T21:32:37Z",
"size": "13",
"version": "1"
}
]
}
Example 2
The following example returns the list of child items in the specified folder. The example uses a public link ID because this folder is under a folder structure not owned by or shared with the current user.
GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/items?orderby=name:asc&limit=2&offset=1
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"childItemsCount": "5",
"count": "2",
"createdBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-06T21:34:23Z",
"description": "PublicLinkDemo",
"errorCode": "0",
"hasMore": "1",
"id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"limit": "2",
"modifiedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"modifiedTime": "2016-06-06T21:34:23Z",
"name": "PublicLinkDemo",
"offset": "1",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"size": "1189",
"totalResults": "5",
"type": "folder",
"items": [
{
"type": "folder",
"id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
"parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"name": "UserBBFolderUpdated",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"modifiedBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-30T23:34:21Z",
"modifiedTime": "2016-07-01T00:01:46Z",
"description": "User BB folder created via public link - updated",
"size": "0",
"childItemsCount": "0"
},
{
"type": "folder",
"id": "F3F6E41BF546376BD3FC6638B5D17B95F47087F4E518",
"parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"name": "UserBFolderDemo",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"modifiedBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-06T21:40:24Z",
"modifiedTime": "2016-06-06T21:40:24Z",
"description": "UserBFolderDemo",
"size": "0",
"childItemsCount": "0"
}
]
}
Example 3
The following example returns the list of child items in the specified folder. The example uses a public link ID protected by an access code because this folder is under a folder structure not owned by or shared with the current user. An access code (test12345) is submitted as part of a Cookie in the request header.
GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/items?orderby=name:asc&limit=2&offset=1
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518 Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"childItemsCount": "5",
"count": "2",
"createdBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-06T21:34:23Z",
"description": "PublicLinkDemo",
"errorCode": "0",
"hasMore": "1",
"id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"limit": "2",
"modifiedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"modifiedTime": "2016-06-06T21:34:23Z",
"name": "PublicLinkDemo",
"offset": "1",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"size": "1189",
"totalResults": "5",
"type": "folder",
"items": [
{
"type": "folder",
"id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
"parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"name": "UserBBFolderUpdated",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"modifiedBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-30T23:34:21Z",
"modifiedTime": "2016-07-01T00:01:46Z",
"description": "User BB folder created via public link - updated",
"size": "0",
"childItemsCount": "0"
},
{
"type": "folder",
"id": "F3F6E41BF546376BD3FC6638B5D17B95F47087F4E518",
"parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"name": "UserBFolderDemo",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"modifiedBy": {
"displayName": "User BB",
"id": "U6A0B35B0548F250914D18FDB5D17B95F470",
"type": "user"
},
"createdTime": "2016-06-06T21:40:24Z",
"modifiedTime": "2016-06-06T21:40:24Z",
"description": "UserBFolderDemo",
"size": "0",
"childItemsCount": "0"
}
]
}
Example 4
The following example requests the list of child items in the specified folder. Because this folder is under a folder structure not owned by or shared with the current user, an access denied error message is returned.
GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/items?orderby=name:asc&limit=2&offset=1
Request Header
None.
Request Body
None.
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{
"errorCode": "-20",
"errorKey": "!csCloudItemInsufficientPrivileges,User BB,fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518,FLD_BROWSE",
"errorMessage": "User 'User BB' has insufficient privilege to access fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518 with service FLD_BROWSE.",
"errorType": "folder",
"id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"isCombined": "1",
"limit": "2",
"offset": "1",
"title": "User 'User BB' has insufficient privilege to access fFolderGUID:F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518 with service FLD_BROWSE.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example 5
The following example requests the list of child items in the specified folder. This folder is under a folder structure not owned by or shared with the current user, and only a public link protected by an access code is available. An error is returned because the access code was not submitted as part of the request.
GET .../folders/F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518/items?orderby=name:asc&limit=2&offset=1
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
None.
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{
"errorCode": "-18",
"errorKey": "!csAccessCodeRequiredForLinkAccess",
"errorMessage": "The access code must be provided to access the link.",
"errorType": "folder",
"id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
"isCombined": "1",
"limit": "2",
"offset": "1",
"title": "The access code must be provided to access the link.",
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Example 6
The following example returns the list of child items in the specified folder. The example uses an applink ID because this folder is under a folder structure not owned by or shared with the current user. The applink ID and access token are submitted in the request header.
GET .../folders/F9681146B0BAAB329B58D6CFB5D17B95F47087F4E518/items?orderby=name:asc
Request Header
appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg== accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ
Request Body
None.
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{
"childItemsCount": "1",
"count": "1",
"createdBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdTime": "2017-06-21T18:51:49Z",
"description": "appLinkTest",
"errorCode": "0",
"hasMore": "0",
"id": "F9681146B0BAAB329B58D6CFB5D17B95F47087F4E518",
"limit": "100",
"modifiedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"modifiedTime": "2017-06-21T18:51:49Z",
"name": "appLinkTest",
"offset": "0",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"size": "0",
"totalResults": "1",
"type": "folder",
"items": [
{
"type": "folder",
"id": "FAA7449732E312E8174731B3B5D17B95F47087F4E518",
"parentID": "F9681146B0BAAB329B58D6CFB5D17B95F47087F4E518",
"name": "subFolderTestByUserB",
"ownedBy": {
"displayName": "User AA",
"id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
"type": "user"
},
"createdBy": {
"displayName": "User BB",
"id": "U5083EA1954687218BA6C3D9B5D17B95F470",
"type": "user"
},
"modifiedBy": {
"displayName": "User BB",
"id": "U5083EA1954687218BA6C3D9B5D17B95F470",
"type": "user"
},
"createdTime": "2017-06-21T18:53:43Z",
"modifiedTime": "2017-06-21T19:09:25Z",
"description": "subFolderTestByUserB CONTRIBUTOR applink - EDITED",
"size": "0",
"childItemsCount": "1"
}
]
}