The Share API enables getting information for a Share URL.
Get Share Info
Share obejct can be retrived with a share token or using the share ID along a user token for the owner of the share.
URL: /api/share[/id]
Method: GET
Request Headers
Authorization | A Bearer authorization token, from auth token api. Example: Authorization: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN |
Response Body
The response body is a JSON formatted representation of the share.
id | The share id. |
name | The name of the share. |
expired | Boolean. Whether or not the share has expired. |
expires | String or null. The expiry date of the share. If null the share never expires. |
owner | User profile for the owner of the share. Object contains: id, username, realname, accountname, email, address, mobile, expires, and status.
Status may be: Active, Inactive, Blocked, or ValidationRequired. |
user | User profile for the receiver of the share. |
permissions |
Contains the permission for the share (all boolean):
|
file id | The id of the shared file or folder |
type | File type: dir or file |
two_factor | Whether or not Two Factor auth is required. See Two Factor Auth API. |
url | The share url. null if user is not the owner of the share. |
email_status | If email share this contains an object with delivery information. The object contains status, timestamp, and message. |
max_file_size |
Integer. Max allowed upload file size in bytes. 0 means no limit. |
available_storage | Integer. Storage left on account in bytes. |
Create Share
URL: /api/share
Method: POST
Request Headers
Authorization | A Bearer authorization token, from auth token api, representing an account user. Example: Authorization: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN |
Request Body
The request body is a JSON formatted.
receiver |
Email to send the share. May be a list of email addresses separated by comma. If non-email share this may be used to set the name of the share. |
file_id | The file or folder id to share. |
subject | Email subject. |
message | Email message. |
expires | Share expiry. Possible values: - null (no expiry) - Date/time specification (ISO8601 or ATOM) - Relative time ("+5 days", "+1 week", "tomorrow", etc) |
Boolean. Specify if share is an email share or an URL share. Default true | |
permissions |
Object. Contains the permission for the share (all boolean):
Note: limitations/configuration on account may force the permissions to specific values. |
return_url_share |
Boolean, default true. If set false and email is true the return share will be the created share. If multiple receivers only the first share will be returned. If true the returned share will be a non-email share which can be used for manual distribution. |
Response Body
If succes the same response as in Get Share Info.
Update Share
URL: /api/share/[id]
Method: PUT
Use the same request body as in POST but may only include values to update.
Delete Share
URL: /api/share/[id]
Method: DELETE
Response code will be 204 if success.