Get Specific Folder Contents

get

/documents/api/1.2/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

Supported Media Types
Path Parameters
  • Globally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value for folderId is self.

Query Parameters
  • Filter 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 filterName parameter.
    • totalResults: The number of items that match the filterName parameter.

  • Specify 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 and maximum is 10000. The following example limits the number of returned items to 10:

    limit=10

  • Specify 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

  • Order the resulting items using the specified field and sort order. You can use the name, createdTime, and modifiedTime fields, and a sort order of ascending (asc) or descending (desc). For example, this is the default:

    orderby=name:asc

Header Parameters
  • Applink access token authorizing the current user to access this folder. This parameter is mandatory if appLinkID is used. It can be used as accessToken or AccessToken.

  • Applink ID authorizing the current user to access this folder. Any time the parameter appLinkID is used, a parameter accessToken must be provided as well. It can be used as appLinkID or AppLinkID.

  • Access 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>

  • Public link ID of a public link authorizing the current user to access this folder. It can be used as linkID or LinkID.

Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : SpecificFolderContents
Type: object
Show Source
Nested Schema : User
Type: object
User information
Show Source
Nested Schema : items
Type: array
The files and subfolders in the folder.
Show Source
Nested Schema : FileAndSubFoldersItemsDefinition
Type: object
The files and subfolders in the folder.
Show Source
Example Response (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":{
        "displayName":"User AA",
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "loginName":"userAALoginName",
        "type":"user"
    },
    "ownedBy":{
        "displayName":"User AA",
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "loginName":"userAALoginName",
        "type":"user"
    },
    "modifiedBy":{
        "displayName":"User AA",
        "id":"U0EAA20910FAF3052ACB79E4T00000000001",
        "loginName":"userAALoginName",
        "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":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "ownedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "modifiedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "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":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "ownedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "modifiedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            }
        }
    ]
}

400 Response

Request parameters are not formatted correctly.

403 Response

Forbidden if the user does not have read permission.

404 Response

Folder ID is not found.

Back to Top

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",
        "loginName": "userAALoginName",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "createdTime": "2014-02-21T20:52:37Z",
    "errorCode": "0",
    "hasMore": "0",
    "id": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
    "modifiedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "id": "U0EAA20910FAF3052ACB79E4T00000000001",
        "type": "user"
    },
    "modifiedTime": "2014-02-21T20:52:37Z",
    "name": "foldera",
    "ownedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "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",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "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",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "U0EAA20910FAF3052ACB79E4T00000000001",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "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",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "createdTime": "2016-06-06T21:34:23Z",
    "description": "PublicLinkDemo",
    "errorCode": "0",
    "hasMore": "1",
    "id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "limit": "2",
    "modifiedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2016-06-06T21:34:23Z",
    "name": "PublicLinkDemo",
    "offset": "1",
    "ownedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "size": "1189",
    "totalResults": "5",
    "type": "folder",
    "items": [
        {
            "type": "folder",
            "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "name": "UserBBFolderUpdated",
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "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",
                "loginName": "userAALoginName",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "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",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "createdTime": "2016-06-06T21:34:23Z",
    "description": "PublicLinkDemo",
    "errorCode": "0",
    "hasMore": "1",
    "id": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
    "limit": "2",
    "modifiedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2016-06-06T21:34:23Z",
    "name": "PublicLinkDemo",
    "offset": "1",
    "ownedBy": {
        "displayName": "User AA",
        "loginName": "userAALoginName",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "type": "user"
    },
    "size": "1189",
    "totalResults": "5",
    "type": "folder",
    "items": [
        {
            "type": "folder",
            "id": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518",
            "parentID": "F4AB9FC75860ECB429D36BA2B5D17B95F47087F4E518",
            "name": "UserBBFolderUpdated",
            "ownedBy": {
                "displayName": "User AA",
                "loginName": "userAALoginName",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "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",
                "loginName": "userAALoginName",
                "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
                "type": "user"
            },
            "createdBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "id": "U6A0B35B0548F250914D18FDB5D17B95F470",
                "type": "user"
            },
            "modifiedBy": {
                "displayName": "User BB",
                "loginName": "userBBLoginName",
                "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/FAD7A87F0613A0CBDD4DA521B5D17B95F47087F4E518/items?orderby=name:asc&limit=2&offset=1

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": "0",
    "createdBy": {
        "displayName": "User AA",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "loginName": "userAALoginName",
        "type": "user"
    },
    "createdTime": "2017-06-14T20:49:08Z",
    "description": "appLinkTest",
    "errorCode": "0",
    "hasMore": "0",
    "id": "FAD7A87F0613A0CBDD4DA521B5D17B95F47087F4E518",
    "limit": "2",
    "modifiedBy": {
        "displayName": "User BB",
        "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
        "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
        "type": "user"
    },
    "modifiedTime": "2017-06-16T17:16:28Z",
    "name": "appLinkTest",
    "offset": "1",
    "ownedBy": {
        "displayName": "User AA",
        "id": "UEB6AD431E4357AE752CE3F2B5D17B95F470",
        "loginName": "userAALoginName",
        "type": "user"
    },
    "size": "0",
    "totalResults": "1",
    "type": "folder"
}
Back to Top