Delete a file or folder

Contents

Delete a file or folder by using file-id.

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

Request Syntax


DELETE /v2/files/:id



Request Headers

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

Value of type: string
true
If-Match A previous file 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 file 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 ID of the file to update.

Value of type: string
true


202 Response

When the id is for a non empty directory, the code will be 202 and completed asynchronously.

204 Response

When the id is for a file or empty directory, the code will be 204 and deleted synchronously.

Example

Sample request to delete a file.

Request


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

Response


HTTP/1.1 204 No Content
Vary: Origin
Date: Mon, 29 Aug 2016 21:49:40 GMT

Have question about this section?