Search files by parent directory

Contents

Search files by parent directory.

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

Request Syntax


GET /v2/filesSearch/parents



Request Headers

Parameter Description Required
Accept-Encoding The value gzip to compress the response.

Value of type: string
false
Authorization An 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-Match A 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-Match A 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

Parameter Description Required
fields The fields to return.

Value of type: csv

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

Value of type: csv

Default: none
false
ids The 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
limit The page size limit.

Value of type: integer

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

Value of type: string

Default: asc
false
orderBy Possible 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
pageToken The pageToken obtained from the last response.

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

Value of type: boolean

Default: false
false


200 Response

OK

Response Headers

Parameter Description Required
Content-Type The value will be application/json. false
Etag An eTag (entity tag) is an HTTP response header used to determine the change in file metadata and content. false


Response Payload

Parameter Description Required
Files The array of files.

Object of type: File
false
pageToken The 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.1
Host: Endpoint-URL
Authorization: Bearer 619085ea-65cb-4b3a-819c-6ac92a3a30f8

Response


HTTP/1.1 200 OK
Content-Type: application/json
Etag: "LmrxXBBM3K-k_8y4umcN6A"
Vary: Origin
Date: Mon, 29 Aug 2016 22:11:35 GMT
Transfer-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
  }
  ]
}

Have question about this section?