Search files by parent directory


Search files by parent directory.

Endpoint URL: {network.internalDNSName or network.proxyURL} received in DeviceInformation

Request Syntax

GET /v2/filesSearch/parents


Request Headers

ParameterDescriptionRequired
Accept-EncodingThe value gzip to compress the response.

Value of type: string
false
AuthorizationAn access token with nas_read_only or nas_read_write scope as well as the File Permission with value ReadFile or FileOwner for the file or a parent.

Value of type: string
true
If-MatchA previous response ETag or *. The If-Match request header makes the request conditional. The server will send back the requested file, only if it matches one of the listed ETags.

Value of type: string
false
If-None-MatchA previous response ETag or *. The If-None-Match request header makes the request conditional. The server will send back the requested file, only if it doesn't have an ETag matching the given ones.

Value of type: string
false


Request Query Parameters

ParameterDescriptionRequired
fieldsThe fields to return.

Value of type: csv

Default: All fields
false
hiddenThe OS for which hidden files should be returned. Possible values mac, linux, windows or none.

Value of type: csv

Default: none
false
idsThe parent ID to search within. The value of root retrieves the user's root-directory. The value of sysroot retrieves system's root-directory (including usb storage roots). The value of trash retrieves the contents of pending deletions.

Value of type: csv

Default: sysroot
false
limitThe page size limit.

Value of type: integer

Default: 20
false
orderPossible values are asc and desc for the ascending and descending sort order respectively.

Value of type: string

Default: asc
false
orderByPossible values name, mTime and size. Always ordered first by the parentID, second by whether the file is a directory (directories first when ascending and last otherwise), and third by the orderBy parameter.

Value of type: string

Default: name
false
pageTokenThe pageToken obtained from the last response.

Value of type: string
false
prettyWhether to pretty print the response.

Value of type: boolean

Default: false
false


200 Response

OK

Response Headers

ParameterDescriptionRequired
Content-TypeThe value will be application/json.false
EtagAn eTag (entity tag) is an HTTP response header used to determine the change in file metadata and content.false


Response Payload

ParameterDescriptionRequired
FilesThe array of files.

Object of type: File
false
pageTokenThe pageToken for the next request. The page token represents the position in the result set (like a bookmark), and is returned when additional results are available.

Value of type: string
false


Example

Sample request to list files in the root folder for the current user.

Request

GET /sdk/v2/filesSearch/parents?ids=root HTTP/1.1Host: Endpoint-URLAuthorization: Bearer 619085ea-65cb-4b3a-819c-6ac92a3a30f8

Response

HTTP/1.1 200 OKContent-Type: application/jsonEtag: "LmrxXBBM3K-k_8y4umcN6A"Vary: OriginDate: Mon, 29 Aug 2016 22:11:35 GMTTransfer-Encoding: chunked{  "pageToken": "",  "files": [  {    "id": "UirCkRtlp8gdUvqzk94ekXg6ElJWCYAAGRIgNhE-",    "parentID": "0cDLqRwqT5sh6iaeNt24k7CaFGmZlSsITSVtg2ct",    "eTag": "\"Bg\"",    "size": 6554,    "mimeType": "image/jpeg",    "mimeTypes": ["image/jpeg"],    "name": "sdk image.jpg",    "mTime": "2016-08-29T21:43:29.655Z",    "cTime": "2016-08-29T21:43:29.655Z",    "extension": ".jpg",    "image": {      "date": "2015-04-30T10:37:58Z",      "width": 20,      "height": 27,      "cameraMake": "sdk camera make",      "cameraModel": "sdk camera model",      "aperture": 2.4,      "exposureTime": 0.016666666,      "isoSpeed": 64,      "focalLength": 4.12,      "flashFired": false,      "orientation": 1,      "latitude": 37.506277777777775,      "longitude": -121.92104444444445,      "altitude": 58.2106135986733    },    "publiclyShared": false,    "privatelyShared": false  }  ]}