Patch a resumable file

Contents

Patch a resumable file. You can use this API to update the file name, MIME type and Parent ID of the existing resumable file.

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

Request Syntax


POST /v2/files/:id/resumable/patch



Request Headers

Parameter Description Required
Authorization An access token with nas_read_write scope as well as a File Permission with value WriteFile or FileOwner for the file or a parent.

Value of type: string
true
If-Match A previous response ETag or *. Return 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 *. Return 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 resumable file ID.

Value of type: string
true


Request Body

Parameter Description Required
cTime The file creation time.

Value of type: dateTime
false
hidden Which OS the file is hidden on. Possible values are mac, linux, windows or none.

Value of type: string
false
mimeType The Media Type of the file. Use application/x.wd.dir for directories.

Value of type: string
false
mTime The file modification time.

Value of type: dateTime
false
name The name of the file.

Value of type: string
false
parentID The parent ID or the alias root.

Value of type: string
false


204 Response

The normal case will be 204.

Response Headers

Parameter Description Required
ETag The ETag for the file metadata and content.

Value of type: string
false


Example

Sample request to patch a resumable file.

Request


POST /sdk/v2/files/f2v8O8_JI70OY4SlIQME7Hr65MoBGKQPi686Qa3w/resumable/patch HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9
Content-Type: application/json
  {
    "name": "renamedFile"
  }

Response


HTTP/1.1 204 No Content
Etag: "Bg"
Vary: Origin
Date: Mon, 29 Aug 2016 22:03:29 GMT

Have question about this section?