PATCH/users/{userId}/drive/files/{fileId}/share

Updates folder sharing.

Authorization

oauth2

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

Scope

file

HTTP Request

PATCHhttps://www.worksapis.com/v1.0/users/{userId}/drive/files/{fileId}/share

Path Parameters

ParameterTypeDescription
userId string 

User ID

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

required
example : me 
fileId string 

File ID


required
example : NzExNTMwMDF8MTQ2NzA1NjAxMDAwMHxGfDA 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 

Request Body

PropertyTypeDescription
members array (object) 

List of members to share the folder with


required 
sendNotification boolean 

Indicates whether to send notifications when sharing a folder. Default: true


default : true 

object

PropertyTypeDescription
userId string 

User ID

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

required
minLength : 1 
userType string 

User type

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

required
Allowed values : USER, ORGUNIT, GROUP 
permissionType string 

Permission type

  • READ: Read permission
  • WRITE: Write permission

required
Allowed values : READ, WRITE 

Request Example

example

1{2  "members": [3    {4      "userId": "userf54b-fc04-4c54-8b9b-7072a326874a",5      "userType": "USER",6      "permissionType": "WRITE"7    }8  ],9  "sendNotification": true10}

Response

HTTP 200

OK

PropertyTypeDescription
rootFileId string 

Root file ID

 
members array (object) 

List of members

 
createdTime string 

Creation time


format : date-time 
modifiedTime string 

Update time


format : date-time 

object

PropertyTypeDescription
userId string 

Member ID


readOnly : true 
userType string 

User type

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

Allowed values : USER, ORGUNIT, GROUP 
permissionType string 

Permission type

  • READ: Read permission
  • WRITE: Write permission

Allowed values : READ, WRITE 
userName string 

First name


readOnly : true 

Response Example

example

1{2  "rootFileId": "MzAyNjY0OTN8MjI3MTE0MTQ2MzA1MnxEfDMwMDcwNDQ",3  "members": [4    {5      "userId": "userf54b-fc04-4c54-8b9b-7072a326874a",6      "userType": "USER",7      "permissionType": "WRITE",8      "userName": "user Name"9    }10  ],11  "createdTime": "2023-06-05T10:54:10+09:00",12  "modifiedTime": "2023-06-05T10:54:10+09:00"13}

HTTP 400

Share/Group member count over limit.: 300

HTTP 404

Resource does not exist.