POST/sharedrives/{sharedriveId}/files/{fileId}/permissions

Creates an access permission for a folder in a collaborative drive.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

file

HTTP Request

POSThttps://www.worksapis.com/v1.0/sharedrives/{sharedriveId}/files/{fileId}/permissions

Path Parameters

ParameterTypeDescription
sharedriveId string 

Collaborative drive ID


required
example : @2101000000000008 
fileId string 

File ID


required
example : NzExNTMwMDF8MTQ2NzA1NjAxMDAwMHxGfDA 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
userId string 

User ID

  • Mail
  • Resource ID
  • External key in "externalKey:{externalKey}" format

required
minLength : 1 
type string 

Permission type

  • READ: Read permission
  • WRITE: Write permission

required
Allowed values : READ, WRITE 

Request Example

example

1{2  "userId": "works@example.com",3  "type": "WRITE"4}

Response

HTTP 201

OK

PropertyTypeDescription
permissions array (FolderPermission) 

Permission information

 

FolderPermission

PropertyTypeDescription
permissionId string 

Permission ID


required
minLength : 1
readOnly : true 
type string 

Permission type

  • READ: Read permission
  • WRITE: Write permission

required
Allowed values : READ, WRITE 
userId string 

User ID


required
minLength : 1
readOnly : true 
userType string 

User type

  • USER: User
  • ORGUNIT: Team
  • GROUP: Group

required
Allowed values : USER, ORGUNIT, GROUP 
userName string 

User name


required
minLength : 1
readOnly : true 

Response Example

example

1{2  "permissions": [3    {4      "permissionId": "QDIxMDAwMDAwMDAwMTcwfEdST1VQfDEwMTAwMDAwMDExNDY1MA",5      "type": "WRITE",6      "userId": "group127-8545-4463-603b-04d550d23bf",7      "userType": "GROUP",8      "userName": "test name"9    }10  ]11}