latestOpenAPI 3.0.02026-07-135965404.0 KB
a1bd874b5960
Shares
Creates a share
Creates a new share object for the given path in your account. We support three types of shares:
- A shared folder allows you to let outside parties access a folder in your account (including any files and nested subfolders) using just a link. Shared folders can be restricted; e.g. with an expiration date, password, download-only, etc. Shared folders are 'live'; if someone makes a change to a file in your shared folder, it will be immediately reflected in your account, and vice-versa.
- A file send lets you send one or more files via an easy download link. File sends are different than shared folders because file sends are 'point in time' -- the recipient will get the files as you sent them. If you later make a change to the source file, it will not be updated for the recipient.
- A receive folder lets you receive files into your account. You can either send users a link, or optionally embed a customized form on your website.
How to send files from your computer using the API:
In order to use the API to send files which are not already stored in your account, you'll need to follow a three-step process:
- Use the POST /shares endpoint to set up your send, including password, recipients, expiration, etc. You must include upload among the permissions in the accessMode and set the sendingLocalFiles parameter to true. The response that is returned will include a "meta" attribute, which contains an accessToken attribute. This new access token is valid only for the send.
- Use the POST /resources/upload endpoint to upload your files to the send you've created. The "/" path represents the root of the share, not your home directory. You must send the access token that you received from the first step in the ev-access-token header
- Use the POST /shares/complete-send/{id} endpoint to indicate that you have finished uploading files to your send. This will trigger the system to remove the upload permission from the share and send any invitation emails you set up in the first step of the process. You must send YOUR access token in the ev-access-token header, not the temporary access token
Setting the Share Permissions
Only 5 different combinations of permissions are valid for the accessMode object:
- Upload Only: This allows share visitors to upload to a share but do nothing else to the contained files. To use this mode, set upload to true and all other permissions to false
- Download Only: This allows share visitors to download files from a share but do nothing else to the contained files. To use this mode, set download to true and all other permissions to false
- Upload and Download: This allows share visitors to upload new files to the share or download files within the share, but not make any other changes to the share contents. To use this mode, set upload and download to true and set both modify and delete to false
- All but Delete: This allows share visitors to make any changes to the contents of a share except deleting files. To use this mode, set upload, download, and modify to true and set delete to false
- Full Access: This allows share visitors to make any changes to the contents of a share. To use this mode, set all 4 permissions upload, download, modify, and delete to true
Any other combination of permissions provided as the accessMode will be rejected as a bad request.
Notes:
Authenticated user requires share permission.
post/shares
Headers
ev-api-keystring required
API Key required to make the API call.
ev-access-tokenstring required
Access token required to make the API call.
Request body
Example request
{
"type": "shared_folder",
"name": "Shared Folder",
"resources": [
"/testfolder"
],
"expiration": "2017-09-25T14:12:10Z",
"isPublic": true,
"notificationEmails": [
"notify@example.com",
"notify2@example.com"
],
"messageSubject": "Invitation to a shared folder"
}Response
Successful operation
ShareResponse required— unresolved $ref