Search for media files by time

Contents

Searches for media files across the time range ordered from newest to oldest. The ordering is first done using the image.date and then by file creation time when image.date is not available. Pictures whose width and height are below 600px are not returned.

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

Request Syntax


GET /v2/filesSearch/mediaTime



Request Headers

Parameter Description Required
Accept-Encoding Request using the Accept-Encoding header, with a value of gzip to compress response data. This reduces network traffic and improves response time.

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 *. Returns the object only if its entity tag (ETag) is the same as the one specified.

Value of type: string
false
If-None-Match A previous response ETag or *. Returns the object only if its entity tag (ETag) is different from the one specified.

Value of type: string
false


Request Query Parameters

Parameter Description Required
endTime The inclusive time for the newest image.

Value of type: dateTime
true
fields The fields to return.

Value of type: csv

Default: All fields
false
limit The page size limit.

Value of type: integer

Default: 20
false
mimeGroups The group of the mimeType's to include. This is the RFC type such as image or application.

Value of type: csv
true
pageToken The pageToken obtained from the last response.

Value of type: string
false
pretty Whether to pretty print the response. It refers to the process of displaying source code or other items in a presentable and attractive way.

Value of type: boolean

Default: false
false
startTime The inclusive time for the oldest image.

Value of type: dateTime
true


200 Response

OK

Response Headers

Parameter Description Required
Content-Type Indicates the media type for the message body. Specify application/json as the content-type. 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.

Array of type: File
true
pageToken The pageToken for the next request.

Value of type: string
false


Example

Sample request to search for image files by time.

Request


GET /sdk/v2/filesSearch/mediaTime?mimeGroups=image&startTime=2010-01-01T00:00:00Z&endTime=2018-01-31T00:00:00Z&limit=4 HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer f3141714-25ba-4437-a7b7-aea3faa02272

Response


{
   "pageToken": "TEt1VXc1OThhTTlmQ2pXRHN1NFE5Sk0zZVIxYVJyRUk1LVBvMkhJOVg",
   "prevToken": "RkdibmVLajFfN1BtNFM0MjJuTjRKOHVyN0hLOVhIcEZialJnTmszOFg",
   "files": [
       {
           "id": "GbneKj1_7Pm4S422nN4J8ur7HK9XHpFbjRgNk38X",
           "parentID": "DPKP111_z_tLx-tB0tpHDXazi3VlY4RABuovWRqr",
           "eTag": "\"Cg\"",
           "size": 77368,
           "mimeType": "image/png",
           "name": "DataModel.PNG",
           "mTime": "2013-11-22T04:22:45Z",
           "cTime": "2018-01-29T19:16:57.531Z",
           "extension": ".PNG",
           "image": {
               "width": 1298,
               "height": 657,
               "previewAvailable": true,
               "previewSourceWidth": 948,
               "previewSourceHeight": 480
           },
           "mimeTypes": [
               "image/png"
           ],
           "trashed": false,
           "family": false
       },
       {
           "id": "mEvgNpU0aP8qw8VxMOwcvi980MjByWkZE3EyVg7Z",
           "parentID": "DPKP111_z_tLx-tB0tpHDXazi3VlY4RABuovWRqr",
           "eTag": "\"Cg\"",
           "size": 19386,
           "mimeType": "image/png",
           "name": "WebsiteDesignStructureScreenshot.PNG",
           "mTime": "2013-11-23T01:17:11Z",
           "cTime": "2018-01-29T19:16:55.635Z",
           "extension": ".PNG",
           "hidden": "none",
           "image": {
               "width": 607,
               "height": 525,
               "previewAvailable": true,
               "previewSourceWidth": 554,
               "previewSourceHeight": 480
           },
           "mimeTypes": [
               "image/png"
           ],
           "trashed": false,
           "family": false
       }
       ,
       {
           "id": "3RF1BmTuHhdklqw1aM1DHOwXOfPtpJVZukFrDQ0j",
           "parentID": "-aDQMj2UB4miOFG3STooWqrC-MiwYHM4r583OuuF",
           "eTag": "\"Cg\"",
           "size": 65383,
           "mimeType": "image/png",
           "name": "Screen Shot 2017-02-08 at 7.09.51 PM.png",
           "mTime": "2017-02-11T18:09:09Z",
           "cTime": "2017-12-16T00:57:50.072Z",
           "extension": ".png",
           "hidden": "none",
           "image": {
               "width": 376,
               "height": 666,
               "previewAvailable": true,
               "previewSourceWidth": 270,
               "previewSourceHeight": 480
           },
           "mimeTypes": [
               "image/png"
           ],
           "trashed": false,
           "family": false
       },
       {
           "id": "1-BiBIlyFWhgb8STJBF1-YGz_5vHWFHn_gkJ5TgO",
           "parentID": "sThX0Q3v6ByO9hkm7h5ItBrF7brWeeimnfRD8py0",
           "eTag": "\"CA\"",
           "size": 5879985,
           "mimeType": "image/jpeg",
           "name": "yi_4k_action_camera_15.jpg",
           "mTime": "2017-12-15T19:42:14Z",
           "cTime": "2017-12-15T19:43:30.553Z",
           "extension": ".jpg",
           "hidden": "none",
           "image": {
               "width": 4000,
               "height": 3000,
               "cameraMake": "XIAOYI",
               "cameraModel": "YDXJ 2",
               "orientation": 1,
               "previewAvailable": true,
               "previewSourceWidth": 1440,
               "previewSourceHeight": 1080
           },
           "mimeTypes": [
               "image/jpeg"
           ],
           "trashed": false,
           "family": false
       },
       {
           "id": "AavzkOVf8y4Ia4eOXzRHIZFbqh-luv2sVRgqOjYV",
           "parentID": "-aDQMj2UB4miOFG3STooWqrC-MiwYHM4r583OuuF",
           "eTag": "\"Cg\"",
           "size": 1478895,
           "mimeType": "image/jpeg",
           "name": "IMG_0029.JPG",
           "mTime": "2016-02-08T22:48:30Z",
           "cTime": "2017-12-16T00:59:10.237Z",
           "extension": ".JPG",
           "hidden": "none",
           "image": {
               "date": "2015-10-01T15:58:42Z",
               "width": 3264,
               "height": 2448,
               "cameraMake": "Apple",
               "cameraModel": "iPhone 5s",
               "aperture": 2.2,
               "exposureTime": 0.033333333,
               "isoSpeed": 200,
               "focalLength": 4.15,
               "flashFired": false,
               "orientation": 6,
               "latitude": 37.40025,
               "longitude": -122.04978888888888,
               "altitude": 10.982926829268292,
               "city": "Sunnyvale",
               "province": "California",
               "country": "United States of America",
               "previewAvailable": true,
               "previewSourceWidth": 1440,
               "previewSourceHeight": 1080
           },
           "mimeTypes": [
               "image/jpeg"
           ],
           "trashed": false,
           "family": false
       }
   ]
   }

Have question about this section?