Create a share.
Operation description
A share, also known as file sharing, is a file view container that exposes one or more files from user space to anonymous users. Anonymous users can access the files within the constraints of the share permissions.
Try it now
Test
RAM authorization
Request syntax
POST /v2/share_link/create HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request parameters. |
|
| drive_id |
string |
Yes |
The drive ID. |
1 |
| share_all_files |
boolean |
No |
Specifies whether to share all files in the drive. |
true |
| file_id_list |
array |
No |
The IDs of the files to share in the parent path. The number of files in the parent path ranges from 1 to 100. If share_all_files is set to true, this parameter does not take effect. Otherwise, you must specify this parameter.`` |
["520b217f13adf4fc24f2191991b1664ce045b393"] |
|
string |
No |
The ID of the file to share in the parent path. |
9520943DC264 |
|
| user_id |
string |
No |
The user ID. |
u123 |
| share_pwd |
string |
No |
The access code. An access code must be 0 to 64 bytes in length. If you do not specify this parameter or leave this parameter empty, the files can be accessed without an access code. In this case, you do not need to specify the share_pwd parameter when you call an operation to query the share URL. The access code can contain only visible ASCII characters. |
abcF123x |
| expiration |
string |
No |
The time when the share URL expires. The value of this parameter follows the RFC 3339 standard. Example: "2020-06-28T11:33:00.000+08:00". If expiration is set to "", the share URL never expires. |
2020-06-28T11:33:00.000+08:00 |
| description |
string |
No |
The description of the share. The description must be 0 to 1,024 characters in length. |
Lecture Room collection |
| share_name |
string |
No |
The name of the share. If you leave this parameter empty, the file name that corresponds to the first ID in the file ID list is used. The name must be 0 to 128 characters in length. |
Lecture Room-1.MP4 |
| disable_preview |
boolean |
No |
Specifies whether to disable the preview feature. |
false |
| disable_save |
boolean |
No |
Specifies whether to disable the dump feature. |
false |
| disable_download |
boolean |
No |
Specifies whether to disable the download feature. |
false |
| preview_limit |
integer |
No |
The limit on the number of times that the shared files can be previewed. The value of this parameter must be equal to or greater than 0. A value of 0 indicates no limit. |
100 |
| save_limit |
integer |
No |
The limit on the number of times that the shared files can be dumped. The value of this parameter must be equal to or greater than 0. A value of 0 indicates no limit. |
100 |
| download_limit |
integer |
No |
The limit on the number of times that the shared files can be downloaded. The value of this parameter must be equal to or greater than 0. A value of 0 indicates no limit. |
100 |
| require_login |
boolean |
No |
Require logon before allowing access to the share |
true |
| office_editable |
boolean |
No |
Allow online editing of shared documents |
true |
| creatable |
boolean |
No |
Allow creating files in folders within the share. When creatable is true, the creatable_file_id_list parameter must also be provided. |
true |
| creatable_file_id_list |
array |
No |
List of folder file IDs where uploads are allowed |
|
|
string |
No |
Folder file ID |
9520943DC264 |
Response elements
|
Element |
Type |
Description |
Example |
| ShareLink |
The data returned. |
Examples
Success response
JSON format
{
"share_id": "7JQX1FswpQ8",
"share_pwd": "abcF123x",
"drive_id": "1",
"file_id_list": [
"[\"xx\"]"
],
"expiration": "2020-06-28T11:33:00.000+08:00",
"expired": false,
"created_at": "2019-08-20T06:51:27.292Z",
"updated_at": "2019-08-20T06:51:27.292Z",
"description": "videos",
"share_name": "video-1.MP4",
"creator": "c9b7a5aa04d14ae3867fdc886fa01da4",
"status": "enabled",
"preview_count": 10,
"save_count": 2,
"download_count": 5,
"report_count": 0,
"video_preview_count": 1,
"access_count": 4,
"disable_preview": false,
"disable_save": false,
"disable_download": false,
"preview_limit": 100,
"save_limit": 100,
"download_limit": 100,
"require_login": false,
"share_all_files": true,
"share_msg": "pwd: 123",
"save_download_limit": 100,
"office_editable": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.