Get Home Folder Contents

get

/documents/api/1.2/folders/items

Get a collection of all items (folders and files) that the user has access to, including folders that others have shared with that user. The type field indicates whether an item is a folder or a file.

Request

Supported Media Types
Query Parameters
  • 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

Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : HomeFolderContents
Type: object
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
Nested Schema : User
Type: object
User information
Show Source
Example Response (application/json)
{
    "count":"3",
    "totalResults":"3",
    "ownerFolderID":"self",
    "hasMore":"0",
    "errorCode":"0",
    "items":[
        {
            "id":"FF4729683CD68C1AFB1AE87DT0000000000100000001",
            "parentID":"self",
            "name":"foldera",
            "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"
            }
        },
        {
            "id":"F4A669A2B7B69F2376C640A9T0000000000100000001",
            "parentID":"self",
            "name":"folderb",
            "type":"folder",
            "size":"0",
            "childItemsCount":"0",
            "createdTime":"2014-02-21T21:38:44Z",
            "modifiedTime":"2014-02-21T21:38:44Z",
            "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":"DBFDB0B6543FB5B68107423AT0000000000100000001",
            "parentID":"self",
            "name":"test cases.txt",
            "type":"file",
            "size":"37786",
            "version":"1",
            "createdTime":"2014-02-21T21:38:52Z",
            "modifiedTime":"2014-02-21T21:38:52Z",
            "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/items?orderby=name:asc&limit=10&offset=10

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "3",
    "errorCode": "0",
    "hasMore": "0",
    "ownerFolderID": "self",
    "totalResults": "3",
    "items": [
        {
            "type": "folder",
            "id": "FF4729683CD68C1AFB1AE87DT0000000000100000001",
            "parentID": "self",
            "name": "foldera",
            "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:52:37Z",
            "modifiedTime": "2014-02-21T20:52:37Z",
            "size": "39",
            "childItemsCount": "2"
        },
        {
            "type": "folder",
            "id": "F4A669A2B7B69F2376C640A9T0000000000100000001",
            "parentID": "self",
            "name": "folderb",
            "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:38:44Z",
            "modifiedTime": "2014-02-21T21:38:44Z",
            "description": "folder b",
            "size": "0",
            "childItemsCount": "0"
        },
        {
            "type": "file",
            "id": "DBFDB0B6543FB5B68107423AT0000000000100000001",
            "parentID": "self",
            "name": "test cases.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:38:52Z",
            "modifiedTime": "2014-02-21T21:38:52Z",
            "size": "37786",
            "version": "1"
        }
    ]
}
Back to Top