Get Home Folder Contents
/documents/api/1.1/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
- application/json
- application/xml
- 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
Response
- application/json
- application/xml
The request was fulfilled.
- count
-
Type:
stringThe number of items listed on the page. - errorCode
-
Type:
stringAn error code of zero (0) indicates no errors. - hasMore
-
Type:
stringThe number of users found. - items
-
Type:
arrayitemsAdditional Properties Allowed:The files and subfolders in the folder. - ownerFolderID
-
Type:
stringGlobally unique identifier (GUID) for the folder. If the referenced folder is the user's home folder, the value is
self. - totalResults
-
Type:
stringTotal number of items in the response.
arrayobject0Example 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":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"modifiedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"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":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"ownedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"type":"user"
},
"modifiedBy":{
"id":"U0EAA20910FAF3052ACB79E4T00000000001",
"displayName":"User AA",
"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":{
"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/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",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedBy": {
"displayName": "User AA",
"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",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedBy": {
"displayName": "User AA",
"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",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdBy": {
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"modifiedBy": "{
"displayName": "User AA",
"id": "U0EAA20910FAF3052ACB79E4T00000000001",
"type": "user"
},
"createdTime": "2014-02-21T21:38:52Z",
"modifiedTime": "2014-02-21T21:38:52Z",
"size": "37786",
"version": "1"
}
]
}