Get file information


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

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

Value of type: string
false
If-None-MatchA 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

ParameterDescriptionRequired
idThe file ID or the alias root.

Value of type: string
true


Request Query Parameters

ParameterDescriptionRequired
fieldsThe fields to return.

Value of type: csv

Default: All fields
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
EtagThe 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

ParameterDescriptionRequired
FileThe 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.1Host: Endpoint-URLAuthorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response

HTTP/1.1 200 OKContent-Type: application/jsonEtag: "3F0ZN_yqhr_K9iJIcAqHSQ"Vary: OriginDate: Mon, 29 Aug 2016 21:46:47 GMTContent-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.1Host: Endpoint-URLAuthorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response

HTTP/1.1 200 OKContent-Type: application/jsonEtag: "wYVyMtluyc7ghOO9k5irPA"Vary: OriginDate: Mon, 29 Aug 2016 21:43:56 GMTContent-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.1Host: Endpoint-URLAuthorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response

HTTP/1.1 200 OKContent-Type: application/jsonEtag: "asK6M7yDa5gnmht3rfOXfg"Vary: OriginDate: Mon, 20 Nov 2017 19:13:52 GMTContent-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.1Host: Endpoint-URLAuthorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9

Response

HTTP/1.1 200 OKContent-Type: application/jsonEtag: "LXBoGLISqdEzCeTKaHTe0A"Vary: OriginDate: Mon, 29 Aug 2016 21:48:09 GMTContent-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}