Creates a share link.
Operation description
A share link allows anonymous users to access one or more files from a user's drive. The permissions for the share link determine the level of access.
Try it now
Test
RAM authorization
Request syntax
POST /v2/share_link/create HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| domain_id |
string |
Yes |
The domain ID. |
|
| body |
object |
No |
The request body. |
|
| drive_id |
string |
Yes |
The ID of the drive. |
1 |
| share_all_files |
boolean |
No |
Set to |
true |
| file_id_list |
array |
No |
A list of 1 to 100 file IDs to share. This parameter is required when |
["520b217f13adf4fc24f2191991b1664ce045b393"] |
|
string |
No |
The ID of the file to share. |
9520943DC264 |
|
| user_id |
string |
No |
The user ID. This parameter is required when authenticating the request with an AccessKey (AK). |
u123 |
| share_pwd |
string |
No |
The password for the share link. It must be between 0 and 64 printable ASCII characters. If this parameter is not set or is an empty string, the share link does not require a password. |
abcF123x |
| expiration |
string |
No |
The expiration time for the share link, specified in RFC 3339 format (for example, "2020-06-28T11:33:00.000+08:00"). To create a share link that never expires, set this parameter to an empty string (""). |
2020-06-28T11:33:00.000+08:00 |
| description |
string |
No |
A description for the share link, 0 to 1,024 characters in length. |
百家讲坛合集 |
| share_name |
string |
No |
The share name. The length must be between 0 and 128 characters. If not specified, the system uses the name of the file corresponding to the first ID in |
百家讲坛-1.MP4 |
| disable_preview |
boolean |
No |
Set to |
false |
| disable_save |
boolean |
No |
Set to |
false |
| disable_download |
boolean |
No |
Set to |
false |
| preview_limit |
integer |
No |
The maximum number of times users can preview the shared files. The value must be 0 or greater. A value of 0 means there is no limit. |
100 |
| save_limit |
integer |
No |
The maximum number of times users can save the shared files. The value must be 0 or greater. A value of 0 means there is no limit. |
100 |
| download_limit |
integer |
No |
The maximum number of times users can download the shared files. The value must be 0 or greater. A value of 0 means there is no limit. |
100 |
| require_login |
boolean |
No |
If |
true |
| office_editable |
boolean |
No |
Set to |
true |
| creatable |
boolean |
No |
Set to |
true |
| creatable_file_id_list |
array |
No |
A list of folder IDs where users can upload files. |
|
|
string |
No |
The ID of a folder. |
9520943DC264 |
Response elements
|
Element |
Type |
Description |
Example |
| ShareLink |
The created share link object. |
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,
"share_all_files": true,
"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.