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

Updates the link for a file in my drive.
The access type can be set to ANYONE or ORGANIZATION.

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}/link

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 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
accessType string 

Link access type

  • ORGANIZATION: Accessible only to members
  • SPECIFIC_PEOPLE: Accessible only to specified users (authenticated with OTP)
  • ANYONE: Accessible to anyone

Allowed values : ORGANIZATION, SPECIFIC_PEOPLE, ANYONE 
linkPermissionType string 

Link permission type (Sharees who access the link can perform only the tasks permitted by the specified permission type.)

  • EDIT: Edit (move, delete, restore, etc.), upload/copy (overwritable), download, preview
  • UPLOAD_DOWNLOAD: Upload/copy (not overwritable), download, preview
  • UPLOAD: Upload/copy (not overwritable), preview
  • DOWNLOAD: Download, preview
  • PREVIEW: Preview

Allowed values : EDIT, UPLOAD_DOWNLOAD, UPLOAD, DOWNLOAD, PREVIEW 
expirationTime string 

Link expiration time (null if there is no expiration date, ISO-8601 format: YYYY-MM-DDThh:mm:ssTZD)

 
password string 

Link password (available only if the accessType is ANYONE)

Caution

  • It can be 4-16 characters long and can only contain English letters, numbers, and special characters.
  • The allowed special characters are: $ ₩ ` - ~ ! @ : ; % ^ & = \ " , _ * + | () {} [] . ? < > / #
 
specificPeople array (string) 

List of members if the accessType is SPECIFIC_PEOPLE.

 

Request Example

example

1{2  "accessType": "SPECIFIC_PEOPLE",3  "linkPermissionType": "PREVIEW",4  "expirationTime": "2020-12-16T19:40:15.15+09:00",5  "specificPeople": [6    "abc@example.com",7    "bcd@example.com"8  ]9}

Response

HTTP 200

OK

PropertyTypeDescription
accessType string 

Link access type

  • ORGANIZATION: Accessible only to members
  • SPECIFIC_PEOPLE: Accessible only to specified users (authenticated with OTP)
  • ANYONE: Accessible to anyone

Allowed values : ORGANIZATION, SPECIFIC_PEOPLE, ANYONE 
hasPassword boolean 

Indicates whether the link has a password.

 
linkPermissionType string 

Link permission type (Sharees who access the link can perform only the tasks permitted by the specified permission type.)

  • EDIT: Edit (move, delete, restore, etc.), upload/copy (overwritable), download, preview
  • UPLOAD_DOWNLOAD: Upload/copy (not overwritable), download, preview
  • UPLOAD: Upload/copy (not overwritable), preview
  • DOWNLOAD: Download, preview
  • PREVIEW: Preview

Allowed values : EDIT, UPLOAD_DOWNLOAD, UPLOAD, DOWNLOAD, PREVIEW 
linkUrl string 

Access URL


readOnly : true 
createdTime string 

Link creation time


readOnly : true 
expirationTime string 

Link expiration time (null if there is no expiration date)


nullable : true 
specificPeople array (string) 

List of members if the accessType is SPECIFIC_PEOPLE.


nullable : true 

Response Example

example

1{2  "accessType": "SPECIFIC_PEOPLE",3  "hasPassword": false,4  "linkUrl": "https://works.do/xzO8Bv",5  "createdTime": "2024-10-10T09:18:24+09:00",6  "expirationTime": "2024-10-17T09:18:24+09:00",7  "linkPermissionType": "EDIT",8  "specificPeople": [9    "abc@example.com"10  ]11}