Create a file permission

Contents

Create a file permission.

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

Request Syntax


POST /v1/filePerms



Request Headers

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

Value of type: string
true


Request Body

Parameter Description Required
entity The entity object to which permission is granted.

Value of type: object
false
entity.id The ID of the entity object to which permission is granted. Values could be a Cloud user ID, a Cloud share's authId or the alias UseMyToken.

Value of type: string
false
entity.type Values could be user or cloudShare. Parameter not required if entity.id is UseMyToken.

Value of type: string
false
fileID The File ID or the alias root.

Value of type: string
false
value Indicates the permissable action. Values could be ReadFile, WriteFile, ReadFilePerms, WriteFilePerms or FileOwner (having all permissions).

Value of type: string
false


201 Response

The normal case will be 201.

Response Headers

Parameter Description Required
Location A relative URL to the created file's permission endpoint.

Value of type: string
false


Example

Sample request to create a file permission.

Request


POST /sdk/v1/filePerms HTTP/1.1
Host: Endpoint-URL
Authorization: Bearer 065eb532-323e-482c-a57e-93cf147baf20
Content-Type: application/json
{
"fileID":"file-id",
"entity":{
  "id":"21105d88-b879-4b6d-bab0-b151ec001078",
  "type":"cloudShare"
  },
"value":"ReadFile"
}

Response


HTTP/1.1 201 Created
Location: /sdk/v2/filePerms/4jp39PRaTVdjS-mRJ_PKzc1LKyIy_5CeRWBkPSDO
Vary: Origin
Date: Fri, 09 Sep 2016 23:01:03 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8

Have question about this section?