POST/users/{userId}/drive/files/{fileId}/link
Creates a link for a file in my drive.
OAuth 2.0 authentication.
For more information, see Authentication and Authorization.
file
| Parameter | Type | Description |
|---|---|---|
| userId | string | User ID
required example : me |
| fileId | string | File ID required example : NzExNTMwMDF8MTQ2NzA1NjAxMDAwMHxGfDA |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
| Content-Type | string | application/json required example : application/json |
| Property | Type | Description |
|---|---|---|
| accessType | string | Link access type
required 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.)
required 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)
|
| specificPeople | array (string) | List of members if the accessType is SPECIFIC_PEOPLE. |
example
1{2 "accessType": "ANYONE",3 "linkPermissionType": "EDIT",4 "expirationTime": "2020-12-16T19:40:15.15+09:00",5 "password": "12345678"6}OK
| Property | Type | Description |
|---|---|---|
| accessType | string | Link access type
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.)
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 |
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}