Get file information

Contents

Retrieves detailed information about a file or folder.

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

Request Syntax


GET /v2/files/:id



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 *. 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 Path Parameters

Parameter Description Required
id The file ID or the alias root.

Value of type: string
true


Request Query Parameters

Parameter Description Required
fields The fields to return.

Value of type: csv

Default: All fields
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 The ETag for the response. An entity tag is an HTTP response header used to determine the change in file content in the My Cloud Home server. Apps can use 'If-None-Match' header to pass ETag information to the server. false


Response Payload

Parameter Description Required
File The File metadata.

Object of type: File
true


Example (Audio)

Sample request to retrieve file information for an audio file.

Request


GET /sdk/v2/files/u1i-dUHnuQgzf6xzdBX1B_NWUjxkyw_txe-VlFip HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response


HTTP/1.1 200 OK
Content-Type: application/json
Etag: "3F0ZN_yqhr_K9iJIcAqHSQ"
Vary: Origin
Date: Mon, 29 Aug 2016 21:46:47 GMT
Content-Length: 505

{
  "id": "u1i-dUHnuQgzf6xzdBX1B_NWUjxkyw_txe-VlFip",
  "parentID": "0cDLqRwqT5sh6iaeNt24k7CaFGmZlSsITSVtg2ct",
  "eTag": "\"Bg\"",
  "size": 9871488,
  "mimeType": "audio/mpeg",
  "mimeTypes": ["audio/mpeg"],
  "name": "abc1.mp3",
  "mTime": "2016-08-29T21:40:04.445Z",
  "cTime": "2016-08-29T21:40:04.445Z",
  "extension": ".mp3",
  "audio": {
    "duration": 308.248875,
    "title": "Ain't It Fun (Promo Radio Edit)",
    "album": "Greatest Hits",
    "artist": "Guns N' Roses",
    "genre": "Rock",
    "year": 2004,
    "trackNum": 12
  },
  "publiclyShared": false,
  "privatelyShared": false
}


Example (Image)

Sample request to retrieve file information for an image.

Request


GET /sdk/v2/files/UirCkRtlp8gdUvqzk94ekXg6ElJWCYAAGRIgNhE- HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response


HTTP/1.1 200 OK
Content-Type: application/json
Etag: "wYVyMtluyc7ghOO9k5irPA"
Vary: Origin
Date: Mon, 29 Aug 2016 21:43:56 GMT
Content-Length: 706

{
  "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
}


Example (Multiple Content)

Sample request to retrieve file information with multiple content and field selection.

Request


GET /sdk/v2/files/H3edQhgTissJUIYpAG7BnzmFja3p4KuBMEUq53IH?pretty=true&fields=id,name,mTime,cTime,mimeTypes HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response


HTTP/1.1 200 OK
Content-Type: application/json
Etag: "asK6M7yDa5gnmht3rfOXfg"
Vary: Origin
Date: Mon, 20 Nov 2017 19:13:52 GMT
Content-Length: 280

{
  "id": "H3edQhgTissJUIYpAG7BnzmFja3p4KuBMEUq53IH",
  "name": "live_photo.heic",
  "mTime": "2017-11-19T22:40:56.635-08:00",
  "cTime": "2017-11-19T22:40:56.635-08:00",
  "mimeTypes": [
    "image/heic",
    "video/quicktime"
  ]
}


Example (Video)

Sample request to retrieve file information for a video file.

Request


GET /sdk/v2/files/X1TY9GQPSzq31csli1M3ZUqLqv2v5R21bs5inI6s HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response


HTTP/1.1 200 OK
Content-Type: application/json
Etag: "LXBoGLISqdEzCeTKaHTe0A"
Vary: Origin
Date: Mon, 29 Aug 2016 21:48:09 GMT
Content-Length: 390

{
  "id": "X1TY9GQPSzq31csli1M3ZUqLqv2v5R21bs5inI6s",
  "parentID": "0cDLqRwqT5sh6iaeNt24k7CaFGmZlSsITSVtg2ct",
  "eTag": "\"Bg\"",
  "size": 6055174,
  "mimeType": "video/quicktime",
  "mimeTypes": ["video/quicktime"],
  "name": "abc1.mov",
  "mTime": "2016-08-29T21:39:54.566Z",
  "cTime": "2016-08-29T21:39:54.566Z",
  "extension": ".mov",
  "video": {
    "bitRate": 1386,
    "frameRate": 30,
    "width": 880,
    "height": 660,
    "duration": 211.843333333
  },
  "publiclyShared": false,
  "privatelyShared": false
}

Have question about this section?