Create a file permission


Create a file permission.

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

Request Syntax

POST /v1/filePerms


Request Headers

ParameterDescriptionRequired
AuthorizationAn 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

ParameterDescriptionRequired
entityThe entity object to which permission is granted.

Value of type: object
false
entity.idThe 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.typeValues could be user or cloudShare. Parameter not required if entity.id is UseMyToken.

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

Value of type: string
false
valueIndicates 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

ParameterDescriptionRequired
LocationA 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.1Host: Endpoint-URLAuthorization: Bearer 065eb532-323e-482c-a57e-93cf147baf20Content-Type: application/json{"fileID":"file-id","entity":{  "id":"21105d88-b879-4b6d-bab0-b151ec001078",  "type":"cloudShare"  },"value":"ReadFile"}

Response

HTTP/1.1 201 CreatedLocation: /sdk/v2/filePerms/4jp39PRaTVdjS-mRJ_PKzc1LKyIy_5CeRWBkPSDOVary: OriginDate: Fri, 09 Sep 2016 23:01:03 GMTContent-Length: 0Content-Type: text/plain; charset=utf-8