This topic describes the sharing feature of Drive and Photo Service (PDS) that uses share links. You can use the feature in the default client, BasicUI, provided by PDS or by calling API operations of PDS.
Usage notes
If a custom domain name is not configured for your enterprise, your enterprise can create up to 500 shares and access shares for up to 500 times each day. If a share is created without restricting access to enterprise internal users, APK and IPA files in the share are not allowed to be downloaded. To remove this restriction, the administrator must configure a custom domain name. For more information, see Custom domain name configuration.
As of 10:00:00 on February 24, 2025 (in UTC+8), APK and IPA files in a newly created share that faces external users cannot be downloaded.
Terms
Term | Description |
share link | The link that a user creates to share files or folders in the user space. Anonymous users can access the shared files or folders by using the share link. The creator of the share link can specify an expiration time and a share password for the share link. This way, only users who are informed of the share password can access the shared files or folders within the validity period of the share link. |
share link creator | The user who creates a share link. The shared files or folders are sourced from the drive. |
share link receiver | The user who accesses the shared files or folders by using the share ID and share password of a share link. An Internet user obtains the share link from a specific channel and opens the share link. In most cases, the share page contains the information about the share ID of the share link. If the creator of the share link specifies a share password for the share link, the system prompts the user to enter the share password to verify the permissions to access the shared files or folders. |
share ID | The unique ID of a share link in the form of a string. Example: sAvciMEXKRz. After a share link is created, the share ID of the share link must be passed in during subsequent operations on the shared files or folders included in the share link. |
share password | The password that the creator of a share link specifies for the share link when the share link is created. Only users who are informed of the share password are authorized to access the share link. |
share token | The token that is required for the receivers of a share link to perform operations on the shared files or folders included in the share link. The operations include listing, viewing, and transferring the shared files or folders. The share token is used to verify the identity of a user who accesses the shared files or folders. The receivers of a share link need to only enter the share password of the share link to access the shared files or folders included in the share link. However, developers must convert the share password into a share token during the calls to API operations so that the receivers can perform subsequent operations on the shared files or folders. |
Sharing process
The following figure shows the process of sharing files or folders.

A creator creates a share link.
The creator forwards the share link to receivers by using channels such as WeChat and forums.
The receivers open the share link to view the basic information about the share link, such as the creator and expiration time of the share link.
If authentication is required, the receivers are prompted to enter the share password for verification.
After the authentication is complete, the receivers can view, transfer, and download the shared files or folders.
API call examples
Create a share link
Create a share link in Drive 1. In this example, the share link includes a file and a folder.
API request syntax
POST /v2/share_link/create
An access token is required for authentication.
Call the CreateShareLink operation to create a share link.
Sample request
{
"drive_id": "1",
"file_id_list": ["6407fca856abesg****", "6407fca856abeyy****"],
"share_pwd": "testSharePwd",
"expiration": "2023-03-09T01:02:03.004Z",
"share_name": "Name of the share link"
}Sample response
{
"share_id": "testShareId",
"share_pwd": "testSharePwd",
"drive_id": "testDriveId",
"file_id_list": ["6407fca856abesg****", "6407fca856abeyy****"],
"expiration": "2023-03-09T01:02:03.004Z",
"created_at": "2023-03-08T07:38:43.408Z"
}View the information about a share link as an anonymous user
The following figure shows the page that appears in BasicUI after an anonymous user opens the share link. In this example, the anonymous user must enter the share password of the share link for authentication. You can specify whether authentication is required based on your business requirements.

API request syntax
POST /v2/share_link/get_by_anonymous
No authentication is required.
Call the GetShareLinkByAnonymous operation to view the information about a share link as an anonymous user.
Sample request
{
"share_id": "testShareId"
}Sample response
{
"creator_id": "testCreatorId",
"creator_name": "testCreatorName",
"creator_phone": "1390000****",
"expiration": "2023-03-09T01:02:03.004Z",
"updated_at": "2023-03-08T07:38:43.408Z",
"avatar": "https://example.com/yyyy",
"share_name": "Name of the share link"
}Obtain a share token
POST /v2/share_link/get_share_token
No authentication is required. The incognito verification feature of Alibaba Cloud is supported. By default, this feature is disabled.
Call the GetShareLinkToken operation to obtain a share token.
Sample request
{
"share_id": "testShareId",
"share_pwd": "testSharePwd"
}Sample response
{
"share_token": "testShareToken",
"expire_time": "2023-03-08T09:51:10.634Z",
"expires_in": 7200
}List shared files or folders
The following figure provides an example of the page that appears after you list shared files or folders.

API request syntax
POST /v2/file/list
A share token is required for authentication.
The operations of managing the shared files or folders included in a share link are similar to those of managing files or folders in a drive, such as the operation of listing files. However, when you call an API operation to manage the shared files or folders included in a share link, you must use a share token for authentication and specify the share_id field rather than the drive_id field to indicate the share link from which the shared files or folders are sourced. This rule also applies when you perform other operations except CopyFile on the shared files or folders included in the shared link. When you call the CopyFile operation to transfer the shared files or folders to a destination drive, you must also specify an access token to verify the permissions to write data to the destination drive.
Call the ListFile operation to list shared files or folders.
Sample request
{
"share_id": "testShareId",
"parent_file_id": "root"
}Sample response
{
"items": [
{
"drive_id": "testDriveId",
"file_id": "testFileId",
"share_id": "testShareId",
"name": "testName",
"type": "folder",
"created_at": "2023-02-17T06:42:30.975Z",
"updated_at": "2023-02-17T06:42:30.975Z",
"parent_file_id": "root"
},
{
"drive_id": "testDriveId",
"file_id": "testFileId",
"share_id": "testShareId",
"name": "testName",
"type": "folder",
"created_at": "2023-02-17T06:42:31.453Z",
"updated_at": "2023-02-17T06:42:31.453Z",
"parent_file_id": "root"
}
],
"next_marker": ""
}View shared files or folders
POST /v2/file/get
A share token is required for authentication.
Call the GetFile operation to view shared files or folders.
Sample request
{
"share_id": "testShareId",
"file_id": "testFileId"
}Sample response
{
"file_id": "testFileId",
"share_id": "testShareId",
"name": "Name",
"type": "folder",
"created_at": "2023-03-08T03:10:32.289Z",
"updated_at": "2023-03-08T03:10:32.289Z",
"parent_file_id": "root"
}Transfer shared files or folders
POST /v2/file/copy
An access token and a share token are required for authentication. The access token is used to verify the permissions to write data to a destination drive, and the share token is used to verify the permissions to read shared files or folders.
Call the CopyFile operation to transfer shared files or folders.
Sample request
{
"share_id": "testShareId",
"file_id": "testFileId",
"to_drive_id": "testToDriveId",
"to_parent_file_id": "root"
}Sample response
{
"drive_id": "testDriveId",
"file_id": "testFileId",
"async_task_id": "testAsyncTaskId"
}