Create a Share
Creates a new share link in your site.
POST https://mysite.files.com/api/v2/shares
Replace mysite.files.com with your site address.
Request Body Schema
The request defines the share's type, included paths, visitor access, and invitation settings. The accessMode and recipients fields contain objects whose properties are described after the main schema.
| Name | Data Type | Notes |
|---|---|---|
type | string | Required. Allowed values are shared_folder, receive and send. |
name | string | Required. A human-readable description that is publicly available to visitors. |
resources | array(string) | Required. One or more paths to include in the share link. Specify each item as either the complete path (e.g. my/folder/file.txt) or as a resource ID (e.g. id:31415926535). When the type of share is shared_folder or receive, you can use only 1 path, which must be a folder. |
accessMode | object | What operations can be performed by a web visitor to the share link. See AccessMode Object for details. |
recipients | array(object) | List of people to be invited to the share. See Recipient Object for details. |
expiration | date-time | When the share link will be unavailable to visitors. Must be in the future. |
hasNotification | boolean | Whether share link notifications are sent. |
isPublic | boolean | When true, the share link is accessible to any web visitor at its address. When false, the share link is only available to recipients who have been emailed a personalized link. |
messageBody | string | Text to include in email invitations to recipients. |
notificationEmails | array(string) | List of email addresses to receive share link notifications. Each email address must be associated with a user account within your site. Ignored if hasNotification is false. |
password | string | Password for visitors to the share link. |
requireEmail | boolean | Whether visitors to the share link are required to register before viewing the contents. |
fileDropCreateFolders | boolean | Whether uploads to the share link are placed into an automatically created subfolder. |
AccessMode Object
The accessMode object included in the request schema has the following properties.
| Name | Data Type |
|---|---|
download | boolean |
upload | boolean |
modify | boolean |
delete | boolean |
Recipient Object
The recipient object included in the request schema has the following properties. You must provide a valid email address for the email property.
| Name | Data Type |
|---|---|
email | string |