API Summary
Cloudike Enterprise REST API allows you to access and use resources and features of Cloudike Enterprise Storage platform, such as creating, removing and restoring users, generating tokens and public links, sharing and unsharing files and folders, creating events and notifications, enabling and disabling accounts, etc. The base URL for all requests in this version of API is https://api.server.com/api/1 The API uses HTTPS protocol to ensure your data privacy. Unencrypted HTTP is not supported. Requests to the API are authorized by HTTP Basic Authentication. Use your account username and password to compute HTTP Authorization header. Parameters in examples (requests and responses) are packed using JSON with UTF-8 encoding and passed as HTTP body with Content-type: application/json. For JSON standard description please refer to RFC 7159. Date and time values should be formatted according to ISO 8601 standard, in UTC timezone.
API methods can be divided into 10 functional groups:
- User and Account Management Methods - User creation and management, basic & OAuth authorization, invitation management, tokens generation and so on.
- Basic Files and Folders methods - basic files and folders operations
- Advanced Files, Folders and Metadata management methods - get, create, restore, diff handling, versioning, etc...
- Extradata methods - methods for work with thumbnails, document preview etc.
- Shared folders or files and public links methods - Methods for public links generation, handling and management, shared folders creation and management.
- Event & Notification methods - events and notifications for user
- Client application specific methods - version queries etc..
- User list management/Administrative tasks methods - accounts lookup, enable/disable etc...
- Analytics methods - Key metrics query methods.
- Configuration KV-storage methods - Configuration R/W methods.
USER MANAGEMENT
admin/accounts_disable/
Disable user
URL: https://api.server.com/api/1/admin/accounts_disable/
Versions:0, 1
Method: POST
Params:
user_id - Mandatory. User ID.
reason - Mandatory. The reason for disabling.
Returns:User data
admin/accounts_enable/
Enable user
URL: https://api.server.com/api/1/admin/accounts_enable/
Versions:1
Method: POST
Params:
user_id - Mandatory. User ID.
reason - Mandatory. The reason for enabling.
Returns:User data
admin/accounts_unlock/
Unlock the user who was locked by multiple wrong password attempts.
URL: https://api.server.com/api/1/admin/accounts_unlock/
Versions:1
Method: POST
Params:
user_id - Mandatory. User ID.
reason - Mandatory. The reason for unlocking.
Returns:User data
admin/accounts_set_password/
Change user password.
URL: https://api.server.com/api/1/admin/accounts_set_password/
Versions:1
Method: POST
Params:
user_id - Mandatory. User ID.
new_password - Mandatory. A new password.
Returns:User data
admin/accounts_generate_login_key/
Generate a temporary login key which can be transferred to /accounts/login for login.
URL: https://api.server.com/api/0/admin/accounts_generate_login_key/
Versions:0
Method: POST
Params:
- user_id - Mandatory. User ID.
Returns:User ID, login key.
Example:
[
1,
"efe59c86aa5d412b9acb039b11cc490ef10b0e4afc35410d383db5e326a7e49d"
]
admin/accounts_find_users/
Returns a list of users according to set parameters (company or system admin access rights needed).
URL: https://api.server.com/api/1/admin/accounts_find_users/
Versions:1
Method: POST
Params:
user_id - Not mandatory. User ID used to find info.
registration_date_from and registration_date_to - Not mandatory. User registration time interval. If parameters are set, users registered within this period are displayed. These parameters can be sent separately or together.
login - Not mandatory. User login.
name - Not mandatory. User name.
last_login_from and last_login_to - Not mandatory. Time interval entered to find users. These parameters can be sent separately or together.
storage_size_from and storage_size_to - Not mandatory. Storage size interval entered to find users. These parameters can be sent separately or together.
is_active - Not mandatory. Active/inactive user.
limit - Not mandatory. The limit to the number of records.
offset- Not mandatory. Offset from the beginning of the list.
order_field - Not mandatory. A sorting field for users list (selected from user properties).
order_direction - Not mandatory. A sorting direction. ASCENDING or DESCENDING.
role - Not mandatory. User role (admin or user).
Returns:Records count, records number limit, list of users, offset in a records list.
Example:
{
"count": 1,
"limit": 20,
"users": [
{
"lang": "ru",
"is_deleted": false,
"userid": 1,
"registration_date": 1376391468605,
"is_active": true,
"storage_size": 558426514,
"hard_quota_size": 0,
"quota_size": 0,
"overhead_size": 0,
"last_login": 1380870848821,
"timezone": "Europe/Moscow",
"deleted_date": 0,
"role": "admin",
"name": "Admin"
}
],
"offset": 0
}
admin/set_effective_userid/
Set an effective user_ID for a token.
URL: https://api.server.com/api/0/admin/set_effective_userid/
Versions:0
Method: POST
Params:
user_id - Mandatory. User ID.
token - Mandatory. Token whose user_ID needs to be changed.
Returns:User data
admin/assign_role/
Assign a role to a new user.
URL: https://api.server.com/api/0/admin/assign_role/
Versions:0
Method: POST
Params:
user_id - Mandatory. User ID.
role - Mandatory. New user role.
Returns:User data
admin/accounts_delete/
Delete an account.
URL: https://api.server.com/api/0/admin/accounts_delete/
Versions:0
Method: POST
Params:
user_id - Mandatory. User ID.
need_wipe - Set this flag if you need to wipe user data on devices.
Returns:User data
admin/accounts_restore/
Restore a user account if it was partially removed.
URL: https://api.server.com/api/0/admin/accounts_restore/
Versions:0
Method: POST
Params:
- user_id - Mandatory. User ID.
Returns:User data
admin/invite_user/
Invite a new user
URL: https://api.server.com/api/0/admin/invite_user/
Versions:0
Method: POST
Params:
email - Mandatory. An email address of the invited user.
invitation - An invitation text.
Returns:User data
company/<company id>/invite_user/
Send an invitation email.
URL: https://api.server.com/api/1/company/<company_id>/invite_user/
Versions:1
Method: POST
Params:
email - Mandatory. An email address of the invited user.
invitation - An invitation text.
lang - Email language (for example "en", "ru", etc).
Returns:User data
company/<company id>/status/
Change or check company status (active or inactive).
URL: https://api.server.com/api/1/company/<company_id>/status/
Versions:1
Method: POST, GET
Params:
company_id - Mandatory. Company identifier from URL string.
status - company status value.
Returns:Company current status
Errors:
403 User has no rights to change the company's settings.
404 Company with the given ID not found.
admin/edit_user/
Edit user data.
URL: https://api.server.com/api/1/admin/edit_user/
Versions:1
Method: POST
Params:
user_id - Mandatory. User ID.
hard_quota_size - Not mandatory. The hard quota does not allow the user to exceed the storage capacity.
quota_size - Not mandatory. The soft quota allows the user to exceed the storage capacity.
region - Not mandatory. User region.
Returns:User data
Errors:
404 User with the given ID not found.
admin/find_companies/
Returns a list of companies.
URL: https://api.server.com/api/1/admin/find_companies/
Versions:1
Method: GET, POST
Params:
offset - an offset value
limit - limit of items
order_field - a sorting field
company_id
- status
- name
- owner_id
- domain
- registration_date
- employees_count
- quota_employees_count
- storage_size
- status
order_direction - sorting direction, available values:
ASCENDING - ascending order
- DESCENDING - descending order
status - status of companies (active, inactive)
company_id_in -json array identifiers of company
name_in - json array names of company
owner_id_in - json array owner_id's of company
domain_in - json array domains of company
storage_size_from - storage size min value
storage_size_to - storage size max value
Returns:
companies - a list of companies, each record is as follows:
company_id - company identifier
- name - company name
- owner_id - identifier of company owner
- employees_count - company employees count
- logo' - logo URL
- domain' - subdomain name
- storage_size - storage size
- quota_size - quota size
- quota_employees_count - quota employees count
- registration_date - company registration date
- public_links_allow - public links allow
- status - company status
- sharing_outside_allow - sharing outside allow
- company_folder_creation_allow - folder creation allow
- name - company name
limit
offset
count
Errors:
403 User has no rights to view a list of companies.
company/<company id>/delete_card_info/
Delete card info.
URL: https://api.server.com/api/1/company/<company_id>/delete_card_info/
Versions:1
Method: POST, GET
Params:
- company_id - mandatory, company identifier from URL string
Returns:
None
Errors:
404 Company with given ID not found
company/<company id>/remove/
Remove company.
URL: https://api.server.com/api/1/company/<company_id>/remove/
Versions:1
Method: POST, GET
Params:
- company_id - mandatory, company identifier from URL string
Returns:
None
Errors:
403 User has no rights to view companies list
404 Company with given ID not found
400 Company cannot be deleted
company/<company id>/set_expired/
Set the company to “expired”.
URL: https://api.server.com/api/1/company/<company_id>/set_expired
Versions:1
Method: POST, GET
Params:
- company_id - mandatory, company identifier from URL string
Returns:
None
Errors:
403 User has no rights to view companies list.
404 Company with given ID not found.
400 Can't set company to “expired”
admin/blocked_logins/
Get a list of locked logins
URL: https://api.server.com/api/1/admin/blocked_logins/
Versions:1
Method: POST, GET
Params:
None
Returns:
A list for blocked logins
Errors:
None
csv_download/
Send information in CSV format about companies or users to a designated email address.
URL: https://api.server.com/api/1/csv_download/
Versions:1
Method: GET
Params:
None
Returns:
- task_id and the destination of the background result
Errors
None
company//request_quota/
Send request to company admin for higher quota
URL
https://api.server.com/api/1/company/
Versions: 1
Method: POST
Params: - user_id - User ID - company_id - Company ID
Returns:
- OK (200)
or
- Company (or User) not found (404)
company//request_quota/
Mark the quota request as viewed
URL
https://api.server.com/api/1/company/
Versions: 1
Method: POST
Params:
sender_id - User ID
receiver_id - Company ID
hash - Request hash
Returns:
- OK (200)
admin/company//edit_user/
Changes a Company quota.
URL
https://api.server.com/api/1/admin/company/
Versions:1
Method: POST
Params:
- user_id - ID of the user (Company) whose quota is to be changed
- quota_size - The quota to be attributed to the user
Returns: - OK code (200)
or
- Error Code for Moderator Does Not Exist (404)
admin/company//approve/
Allows system admin to approve a company's registration
URL
https://api.server.com/api/1/admin/company/
Versions: 1
Method: GET
Params:
- company_id - ID of the company
- hash - hash of the company to approve
Returns:
- OK code (200 Company is approved)
or (Company is not approved)
- Error Code for Company Not Found (404)
- Error Code for Forbidden Operation (403)
admin/company//deny/
Allows system admin to deny a company's registration
URL
https://api.server.com/api/1/admin/company/
Versions: 1
Method: POST
Params:
- company_id - ID of the company
- hash - hash of the company
Returns:
- OK code (200 Company is denied)
or (Company is not denied)
- Error Code for Company Not Found (404)
- Error Code for Forbidden Operation (403)
moderators/add/
URL https://api.server.com/api/1/moderators/add/
Versions: 1
Method: POST
Params:
- email - Moderator email
- name - Moderator name (optional)
Returns:
- OK code (200)
or
- Error Code for Moderator Already Exists (403)
moderators/get/
Get list of Moderators
URL https://api.server.com/api/1/moderators/get/
Versions: 1
Method: GET
Params:
None
Returns: - List of moderators
moderators/remove/
Remove Moderator
URL https://api.server.com/api/1/moderators/remove/
Versions: 1
Method: POST
Params:
- email - Moderator email
Returns:
- OK code (200)
or
- Error Code for Moderator Does Not Exist (404)
request_token/
Returns session token for Authorization
URL https://api.server.com/api/1/request_token/
Versions: 1
Method: GET
Params:
None
Returns:
- token
Errors:
- 404 - The task is not found.
- 400 - An error occurred while a background task was performed.
ANALYTICS
analytics/get_data/
Returns metrics data.
URL: /https://api.server.com/api/0/analytics/get_data/
Versions:0
Method: GET
Params:
token - an authorization token.
date_from - date range, in timestamp
date_to - date range, in timestamp
metric - metrics name
period - period [day, week, month]
region - region for which data is requested
Returns:
Metrics value.
Errors:
404 Key not found
Notes:
Admin rights are required.
Example
[
{
"region": "all",
"period": "day",
"name": "total_storage_size",
"value": "2066956777",
"time": 1384113600
},
{
"region": "all",
"period": "day",
"name": "total_storage_size",
"value": "2066958782",
"time": 1384200000
},
{
"region": "all",
"period": "day",
"name": "total_storage_size",
"value": "2066958782",
"time": 1384286400
},
]
analytics/get_multiple_data/
Returns metrics data by a given list of metrics.
URL: https://api.server.com/api/0/analytics/get_multiple_data/
Versions:0
Method: POST
Params:
- date_from - Mandatory. The time interval in timestamp
- date_to - Mandatory. The time interval in timestamp
- metrics - Mandatory. Metric name
Returns:
A list of metrics values grouped by a metric name
Notes:
Admin rights are required.
Example
{
"total_storage_size":
[
{
"value": "2066956777",
"time": 1384113600
},
{
"value": "2066958782",
"time": 1384200000
}
],
"files_added_count":
[
{
"value": "2066958782",
"time": 1384286400
}
]
}
analytics/get_metrics/
Returns metrics list.
URL: https://api.server.com/api/0/analytics/get_metrics/
Versions:0
Method: GET
Returns:
Metrics list with parameters.
Notes:
Admin rights are required.
Example
{
"avg_storage_size_all": {
"only_current": true,
"name": "avg_storage_size_all",
"periods": [
"day"
]
},
"files_added_count": {
"only_current": false,
"name": "files_added_count",
"periods": [
"day"
]
},
"uniq_users_all": {
"only_current": false,
"name": "uniq_users_all",
"periods": [
"day"
]
},
"avg_storage_size": {
"only_current": true,
"name": "avg_storage_size",
"periods": [
"day"
]
},
"total_files_count": {
"only_current": true,
"name": "total_files_count",
"periods": [
"day"
]
},
"uniq_users": {
"only_current": false,
"name": "uniq_users",
"periods": [
"day",
"week",
"month"
]
},
}
BACKGROUND TASKS
task/<taskid>/
Gets the result of performing a background task by the taskid obtained while setting a task for execution.
URL: https://api.server.com/api/1/task/<taskid>/
Versions:1
Method: GET
Params:
- taskid - Mandatory. Background task identifier.
Returns:
Any JSON dictionary. The task adds resulted data to the dictionary after
the task has been completed.
Errors:
404 The task is not found.
400 An error occurred while a background task was performed.
COPYRIGHT
copyright/make_complaint/
Creates a complaint about unlicensed content. The method does not require authorization.
URL: https://api.server.com/api/0/copyright/make_complaint/
Versions:0
Method: POST
Params:
content_type - Mandatory. The type of content.
url - Mandatory. Violation Addresses List.
description - Mandatory. Description of the copyright in respect of which there are violations.
copyright_holder - Mandatory. The name of a copyright holder.
name - Mandatory. The name of a complainer.
sign - Mandatory. Entering a full name in this field is equivalent to a digital signature.
email - Mandatory. The email of a complainer.
position - Not mandatory. The position of a complainer.
phone - Not mandatory. The phone number of a complainer.
fax - Not mandatory. The fax number of a complainer.
address - Not mandatory. The address of a complainer.
city - Not mandatory. The city of a complainer.
region - Not mandatory. The region of a complainer.
postcode - Not mandatory. The postcode of a complainer.
country - Not mandatory. The country of a complainer.
Returns:
Complaint created in JSON format.
Example
{
"status": "new",
"city": "NN",
"fax": "+79260121212",
"description": "stolen movie",
"created": "2014-03-12T19:41:34.733818",
"url": [
"http://web-dev.mountbit.com/public/xWKEMAg/",
"http://p.mountbit.com/AclB9Ag/"
],
"country": "Russia",
"region": "NN",
"phone": "+79260121212",
"complaint_id": 1,
"copyright_holder": "qwerty inc(c)",
"postcode": 123456,
"content_type": "Video",
"address": "lenina str",
"position": "manager",
"email": "root@root.com",
"name": "user"
}
copyright/get_complaints/
Returns a list of complaints, the method requires administrator rights during authorization.
URL: https://api.server.com/api/0/copyright/get_complaints/
Versions:0
Method: POST
Params:
content_type - Mandatory. The type of content.
copyright_holder - Mandatory. Copyright holder name.
name - Mandatory. The name of the complainer.
email - Mandatory.
complaint_id - Not mandatory. Complaint ID.
position - Not mandatory. Complainer position.
phone - Not mandatory. Complainer position.
fax - Not mandatory. Complainer fax number.
address - Not mandatory. Complainer address.
city - Not mandatory. Complainer city.
region - Not mandatory. Complainer region.
postcode - Not mandatory. Complainer postcode.
country - Not mandatory. Complainer country.
status - Not mandatory. Complaint status [new, accepted, rejected, rejected_on_appeal]
limit - Not mandatory. Complaints limit.
offset - Not mandatory. An offset from the first complaint.
order_field - Not mandatory. A sorting field.
order_direction - Not mandatory. A sorting direction.
Returns:
A list of complaints
Example
{
"complaints": [
{
"status": "new",
"city": "NN",
"fax": "+79260121212",
"description": "stolen movie",
"created": "2014-03-12T19:58:48.326000",
"url": [
"http://web-dev.mountbit.com/public/Xy15aAg/",
"http://p.mountbit.com/0560bAg/"
],
"country": "Russia",
"region": "NN",
"phone": "+79260121212",
"complaint_id": 1,
"copyright_holder": "qwerty inc(c)",
"postcode": 123456,
"content_type": "Video",
"address": "lenina str",
"position": "manager",
"email": "root@root.com",
"name": "user"
},
{
"status": "new",
"city": "NN",
"fax": "+79260232323",
"description": "stolen movie",
"created": "2014-03-12T19:58:48.326000",
"url": [
"http://web-dev.mountbit.com/public/REdXwAg/"
],
"country": "Russia",
"region": "NN",
"phone": "+79260232323",
"complaint_id": 2,
"copyright_holder": "zxcvbn inc(c)",
"postcode": 123456,
"content_type": "Audio",
"address": "lenina str",
"position": "manager",
"email": "root1@root.com",
"name": "user"
}
],
"count": 2,
"limit": 2000,
"offset": 0
}
copyright/edit_complaint/
Edit the status of complaints; the method requires administrator rights during authorization
URL: https://api.server.com/api/0/copyright/edit_complaint/
Versions:0
Method: POST
Params:
complaint_id - Not mandatory. Complaint ID.
status - Not mandatory. New complaint status. The possible values are as follows: [new, accepted, rejected, rejected_on_appeal]
Errors:
404 Complaint not found
EVENTS
events/
Returns a list of user events sorted by time in descending order
URL: https://api.server.com/api/0/events/
Versions:0
Method: GET
Params:
skip - Not mandatory. The initial data offset. Allows organizing pagination.
limit - Not mandatory. Limit the number of entries. The maximum value is 100. The default value is 20.
type - Not mandatory. Filtering by event type.
person - Not mandatory. Filtering by event trigger. May take the following values:
- me - event trigger is the current user;
- other - event trigger is not the current user.
from_timestamp - Not mandatory. The start date of the selection.
to_timestamp - Not mandatory. The end date of the selection.
Returns:
Event array
Values description:
type - Event type. See below.
timestamp - Event time - UNIX timestamp UTC, with milliseconds.
path - Full path to a file or a folder.
deleted - Flag - Shows if the object is deleted or not.
oldname - Added to rename events. The old name of the folder or file.
oldpath - Added to move events. Old folder or file path.
old - Added to move and rename events. Information about the old folder or file (content and version).
user_id - Added to events of adding and removing collaborators. The ID of the added or deleted collaborator.
content - Added to file events. See / metadata for description of embedded fields.
version - Added to events above files. File version number.
Event types:
- Folder events:
- folder_created - Folder creation event.
- folder_deleted - Folder delete event.
- folder_renamed - File rename event.
- share_invitation_sent - The event of adding a new collaborator
to a folder. The event is received by everyone with whom the folder is
shared, including new collaborators.
- share_invitation_accepted - The event of accepting an invitation
to a shared folder by a collaborator. An event is received by everyone
with whom a folder is shared, including new collaborators.
- share_invitation_declined - Event of refusal of an invitation to
a shared folder by a collaborator. An event is received by everyone who
has a shared folder, including a new collaborator.
- share_invitation_revoked - The event of canceling the invitation
to the shared folder by the owner of the folder. The event is received
by everyone who has a shared folder, including a collaborator.
- folder_collab_removed - Folder collaborator deletion event, all
collaborators receive.
- folder_unshared - Folder sharing cancellation events, get all
collaborators
- folder_undeleted - Folder Recovery Event.
- folder_moved - The event of a folder moving from one place to another.
- File events:
-file_created - File creation event.
- file_deleted - File delete event.
- file_undeleted - File recovery event.
- file_new_content - File new version creation event.
- file_version_restored - File restore event.
- file_renamed - File rename event.
- file_moved - The event of moving a file from one directory to
another.
Example
[
{
"user_id": 1,
"deleted": false,
"timestamp": 1339568818575,
"init_event_user_name": "Valentin",
"content": {
"created": 1339568817601,
"modified": 1339568818567,
"size": 5503
},
"version": 2,
"path": "/src/web.c",
"type": "file_created",
"init_event_user_id": 1
},
{
"user_id": 1,
"deleted": true,
"timestamp": 1339568818576,
"init_event_user_name": "Valentin",
"content": {
"created": 1339568817605,
"modified": 1339568818564,
"size": 55
},
"version": 2,
"path": "/src/file.ext",
"type": "file_deleted",
"init_event_user_id": 1
},
{
"user_id": 1,
"deleted": true,
"timestamp": 1339568818576,
"init_event_user_name": "Valentin",
"content": {
"created": 1339568817605,
"modified": 1339568818564,
"size": 55
},
"version": 2,
"path": "/dst/file1.ext",
"oldpath": "/src/file1.ext",
"old": {
"content": {
"created": 1339568817605,
"modified": 1339568818560,
"size": 55
},
"version": 1
},
"type": "file_moved",
"init_event_user_id": 1
}
]
check_ws/
A Web socket URL functional test.
URL: https://api.server.com/api/0/check_ws/
Versions:0
Method: GET, POST
Params:None
Returns:Success or not
Errors:None
EXTRADATA
files/create_extra/
The method forcibly creates extra data for the specified file. Creation
can occur either in real time or with delay through the queue and
depends on the settings of the plugins that are responsible for creating
extra data of a certain type.
Theoretically, if there are several types of extra data for one file,
then they will all be created as a result of this API method. That is,
you cannot select any particular plugins to create extra data.
At the same time, it is worth mentioning that this situation, when
several extra data plugins correspond to one file, does not seem real
yet. If extra data already exists for some file, then they will be
recreated as a result of this method.
URL: https://api.server.com/api/0/files/create_extra/
Versions:0
Method: POST
Params:
path - Mandatory. The path to the file for which extra data is created.
version - Not mandatory. File version number.
Returns:
started: The value is True if extra data is queued for creation (depends on plugins) and False - if no task has been set.
Errors:
404 The file at the specified path was not found, or a nonexistent
version was specified.
files/get_preview/
Get a preview file
URL: https://api.server.com/api/0/files/get_preview/
Versions:0
Method: GET
Params:
path - Mandatory. The path to the file for which extra data is created.
version - Not mandatory. File version number.
page - Page number
Returns:
Preview file.
Errors:
404 The file at the specified path was not found, or a nonexistent
version was specified.
links/get_preview/
Get a preview file
URL: https://api.server.com/api/1/links/get_preview/
Versions:1
Method: GET
Params:
hash - Mandatory. The hash of the published node, some kind of id, by which the node is searched
path - Mandatory. The path to the file or folder relative to the published directory
Returns:
Preview file.
Errors:
404 The file at the specified path was not found, or a nonexistent version was specified.
shares/get_preview/
Get a preview file
URL: https://api.server.com/api/1/shares/get_preview/
Versions:1
Method: GET
Params:
hash - Mandatory. The hash of the published node, some kind of id, by which the node is searched.
path - Mandatory. The path to the file or folder relative to the published directory.
Returns:
Preview file.
Errors:
404 The file at the specified path was not found, or a nonexistent version was specified.
links/create_extra
Forcibly creates extra data for the specified file. The method is similar to the API / files / create_extra, but only for public files.
URL: https://api.server.com/api/0/links/create_extra
Versions:0
Method: POST
Params:
hash - Mandatory. The hash of the published node, some kind of id, by which the node is searched
path - Mandatory. The path to the file or folder relative to the published directory.
Returns:
started: The value is Trueif extra data is queued for creation (depends on plugins), False - if no task has been set.
Errors:
404 Node not found. The possible reasons: path is incorrectly set, the node has ceased to be published, or has been deleted.
shares/create_extra/
Forcibly creates extra data for the specified file. Creation can occur
either in real time or with delay through the queue and depends on the
settings of the plugins that are responsible for creating extra data of
a certain type.
Theoretically, if there are several types of extra data for one file,
then they will all be created as a result of this API method. That is,
you cannot select any particular plugins that will create extra data.
At the same time, it is worth mentioning that this situation, when
several extra data plugins correspond to one file, does not seem real
yet. If extra data already exists for some file, then as a result of
this method they will be recreated.
URL: https://api.server.com/api/1/shares/create_extra/
Versions:1
Method: POST
Headers:MountbitAuth - user authorization token. If the shared folder is public, then this parameter is not Mandatory.
Params:
invite_hash - Mandatory. The unique hash of the user’s invitation to the shared folder obtained by calling the /folders/shared/add/method.
path - Mandatory. The path to the file, relative to the published directory.
Returns:
started: The*Truevalue - if extra data is queued for creation (depends on plugins), **False* - if no task has been set.
Errors:
403 Insufficient rights to access a shared folder;
404 Folder or file not found.
GROUPS (GROUP MANAGEMENT)
groups/create/
Create a new group (company admin access rights are required).
URL: https://api.server.com/api/1/groups/create/
Versions:1
Method: POST
Params:
- name - the name of a new group
Returns:
200 A group created
403 A group already exists
404 Company not found
groups/delete/
Delete the group by name and company (company admin access rights are required).
URL: https://api.server.com/api/1/groups/delete/
Versions:1
Method: POST
Params:
- name - The name of a group
Returns:
200 group deleted
404 CompanyNotFound - company not found
404 GroupNotFound - group not found
groups/list/
Show a list of company groups.
URL: https://api.server.com/api/1/groups/list/
Versions:1
Method: POST, GET
Params:
limit - Not mandatory. Offset value.
offset - Not mandatory. Limit of items
order_by - Not mandatory. Default value: 'name'. Set a sorting field and order, a negative value for reverse sort order. The possible values: 'name', '-name', 'members_count', '-members_count'
Returns:
groups - companies groups list, each record is as follows:
- group_id - group's identifier
- name - The name of a group
- company_id - companies identifier
- members_count - count of group members
limit - list limit
offset - list offset
count - all groups count
Errors:
404 CompanyNotFound - company not found
Example
{
"count": 10,
"limit": 2,
"offset": 0,
"groups": [
{
"group_id": "1",
"name": "blood group",
"company_id": 2,
"members_count": 3,
},{
"group_id": "2",
"name": "my group",
"company_id": 2,
"members_count": 1,
}
]
}
groups/<group_id>/change/
Change group settings (company admin access rights needed).
URL: https://api.server.com/api/1/groups/<group_id>/change/
Versions:1
Method: POST
Params:
group_id - mandatory, group identifier from URL string
name - mandatory, group name
Returns:
group_id - group identifier
name - group name
company_id - group company identifier
members_count - count of group members
Errors:
403 User has no rights to change group settings.
403 GroupAlreadyExists - group already exists
404 GroupNotFound - Group with the given ID not found.
Example
{
"group_id": "2",
"name": "my group",
"company_id": 2,
"members_count": 11,
}
groups/<group_id>/add_user/
Add a user into a group.
URL: https://api.server.com/api/1/groups/<group_id>/add_user/
Versions:1
Method: POST
Params:
group_id - Mandatory. Group identifier (from URL string).
user_ids - Mandatory. A list of user identifiers.
Returns:
- List of added users with info or fail codes.
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
Example
[
{"userid": 1, "status": "added"},
{"userid": 2, "status": "added"},
{"userid": 3, "status": "error", "code": 403, "message": "User not found"}
]
groups/<group_id>/remove_user/
Remove a user from a group.
URL: https://api.server.com/api/1/groups/<group_id>/remove_user/
Versions:1
Method: POST
Params:
group_id - Mandatory. Group identifier (from URL string).
user_ids - Mandatory. A list of user identifiers.
Returns:
- List of removed users with info or fail codes (see group_add_user API method).
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/users/
Show a list of group members.
URL: https://api.server.com/api/1/groups/<group_id>/users/
Versions:1
Method: POST, GET
Params:
group_id - Mandatory. Group identifier (from URL string).
limit - Not mandatory. Offset value.
offset - Not mandatory. Limit of items.
Returns:
users - users list
limit - list limit
offset - list offset
count - all groups count
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/change_can_print
Change the group's option “can_print”.
URL: https://api.server.com/api/1/groups/<group_id>/change_can_print
Versions:1
Method: POST
Params:
group_id - mandatory, user ID
value - mandatory, option value
Returns:
Group public information.
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/change_can_download
Change the group's option “can_download”.
URL: https://api.server.com/api/1/groups/<group_id>/change_can_download
Versions:1
Method: POST
Params:
group_id - mandatory, user ID.
value - mandatory, option value.
Returns:
Group public information
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/change_pc_can_download
Change the group's option “pc_can_download”.
URL: https://api.server.com/api/1/groups/<group_id>/change_pc_can_download
Versions:1
Method: POST
Params:
group_id - mandatory, user ID
value - mandatory, option value
Returns:
Group public information
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/change_use_watermarks
Change the group's option “use_watermarks”.
URL: https://api.server.com/api/1/groups/<group_id>/change_use_watermarks
Versions:1
Method: POST
Params:
group_id - mandatory, user ID.
value - mandatory, option value.
Returns:
Group public information
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
groups/<group_id>/change_mobile_restriction
Change the group's option “user_mobile_restriction”.
URL: https://api.server.com/api/1/groups/<group_id>/change_mobile_restriction
Versions:1
Method: POST
Params:
group_id - mandatory, user ID
value - mandatory, option value
Returns:
Group public information.
Errors:
403 GroupForbidden - group in another company
404 GroupNotFound - group not found
KEY VALUE
keyvalue/<key_name>
Return/set a value of the specified key.
URL: https://api.server.com/api/0/keyvalue/<key_name>
Versions:0
Method: GET, POST
Params:
value. New key value (string in JSON) - for POST-request.
rights. Key rights.
Returns:
The key value for the GET request.
Errors:
404 Key not found
GET result example:
{
"key": "some_key",
"value": [1, 2, "string"]
}
POST result example:
{
"key": "some_key",
"changed": true
}
KUKUDOCS
kukudocs/view/
Get preview file for user.
URL: https://api.server.com/api/1/kukudocs/view/
Versions:1
Method: POST
Params:
path - Mandatory. Relative file path to /home/userid directory.
version - Not mandatory. File version.
Returns:
url - preview URL for the file.
Errors:
404 UserNotFound, FileNotFound, CompanyNotFound
500 InternalError - kukudocs converting failed.
kukudocs/link/view/
Get preview file for link.
URL: https://api.server.com/api/1/kukudocs/link/view/
Versions:1
Method: POST
Params:
path - Mandatory. Relative file path to parent public linked directory.
hash - Mandatory. The hash value of a public link.
password - Not mandatory. A password of public link. (optional)
Returns:
URL - preview URL for the file.
Errors:
404 UserNotFound, FileNotFound, CompanyNotFound
500 InternalError - kukudocs converting failed.
MSOFFICE
wopi/view/
Get MS preview URL.
URL: https://api.server.com/api/1/wopi/view/
Versions:1
Method: POST
Params:
- path - String. File's path.
Example
{
"url": "https://example.com/something",
}
wopi/link/view/
Get MS preview URL.
URL: https://api.server.com/api/1/wopi/link/view/
Versions:1
Method: POST
Params:
path - String. File's path.
public_hash - String. Link public hash
Example
{
"url": "https://example.com/something",
}
wopi/edit/
Get MS edit URL.
URL: https://api.server.com/api/1/wopi/edit/
Versions:1
Method: POST
Params:
- path - String. File's path.
Example
{
"url": "https://example.com/something",
}
wopi/files/<file_id>
Wopi files.
URL: https://api.server.com/api/1/wopi/files/(file_id)
Versions:1
Method: GET, POST
Params:
- file_id - Query string. File's ID.
wopi/files/<file_id>/contents
Wopi files contents.
URL: https://api.server.com/api/1/wopi/files/(file_id)/contents
Versions:1
Method: GET, POST
Params:
- file_id - Query string. File's ID.
NOTICES
notices/
Returns a list of notification events for the user, sorted by time in descending order.
URL: https://api.server.com/api/0/notices/
Versions:0
Method: GET
Params:
Type - Not mandatory. Filter by notification type:
- global - A notification is sent to all users.
- personal - The notification is intended for a specific user.
- global - A notification is sent to all users.
Behavior - Not mandatory. Filter by notification behavior type:
- interactive - Notification requires user response (confirmation,
cancellation, etc.)
- static - The purpose of such a notification is simply to convey information to the user.
- interactive - Notification requires user response (confirmation,
cancellation, etc.)
Status - Not mandatory. Filter by notification status:
- new - new notification.
- viewed - notification is viewed (for static notifications).
- waiting - notification is pending confirmation.
- declined - notification is declined.
- accepted - notification is accepted.
- new - new notification.
Returns:
An array of notifications.
Example
[
{
"status": "accepted",
"hash": "a4d7e0dc51baf3c9d43417fc09059eae",
"timestamp": 1339072903641,
"init_notice_user_name": "maxim",
"path": "/My Folder",
"init_notice_user_id": 20,
"user_id": 1,
"modified": 1339075676379,
"behavior": "interactive",
"text": "My Folder",
"action": "share_invitation_sent",
"type": "personal"
}
]
SOFT
soft/get_version/
Returns the current version of the client application for the specified platform.
URL: https://api.server.com/api/0/soft/get_version/
Versions:0
Method: GET
Params:
- platform - Not mandatory. Type of a platform - Windows or Mac - for which program the version is requested. If not transferred, it returns versions for all platforms.
Returns:
An object that describes the current version of the application for a
given platform.
Errors:
403 A version is requested for a non-existent platform.
Example
{
"version": {
"link": "http://qwe.ru/qe.exe",
"platform": "windows",
"version": "123",
"critical": true,
"description": "New version 123"
}
}
soft/set_version/
Installs a new version or updates the current version of the client application for the specified platform. (Admin rights are required).
URL: https://api.server.com/api/0/soft/set_version/
Versions:0
Method: GET
Params:
platform - Mandatory. The platform type.
version - Mandatory. If the transferred version already exists, then it will be updated, otherwise, a new one will be created.
link - Mandatory. Application version download link.
description - Not mandatory. Short version description.
competition - Not mandatory. The so-called coefficient of competition. It can take values from 0 to 10. It determines which part of users will receive the latest version of the application and which will not. The probability is determined by the formula: x = user_id mod competition. If x = 0, then the user with id = user_id will receive the latest version of the application, otherwise, the previous one (if the previous version is defined). This formula and coefficient are applied only if the method is requested by an authorized user. In the case of an unauthorized (i.e. anonymous) user, this mechanism is not applicable, and the latest version of the application will always be issued.
critical - Not mandatory. Indicates how critical this version of the application is.
Returns:
An object that describes the current version of the application for a
given platform.
Example
{
"link": "http://qwe.ru/qe.exe",
"platform": "windows",
"version": "123",
"critical": true,
"description": "New version 123",
"competition": 0
}
soft/list_version/
Returns a list of versions for all platforms or for one specific platform.
URL: https://api.server.com/api/0/soft/list_version/
Versions:0
Method: GET
Params:
- platform - Not mandatory. The platform type. If the parameter is passed, the method will return a list of versions for the requested platform. Otherwise, a list of versions for all platforms.
Returns:
A list of versions sorted in order from the most recent versions to the
older ones (i.e., by the time they were added).
soft/get_update/
Returns currently available update.
URL: https://api.server.com/api/0/soft/get_update/
Versions:0
Method: GET
Params:
- platform - Mandatory. The platform type (Windows or Mac) an update is requested for.
Returns:
Describes the currently available update for a given platform.
Format Object:
{ version number: download link }
Errors:
403 An update for a non-existent platform is requested.
Example
{
"1.0": "http://updates.server.com/ver1.0.zip"
}
soft/set_update/
Installs a new update for the specified platform. (Admin rights are required).
URL: https://api.server.com/api/0/soft/set_update/
Versions:0
Method: GET
Params:
platform - Mandatory. Platform type.
link_base - Mandatory. Update the download link.
version_base - Mandatory. Update version.
link_exp - Not mandatory. Experimental update download link.
version_exp - Not mandatory. A version of the experimental update.
competition - Not mandatory. The so-called coefficient of competition. Determines which part of the users will receive the standard update and which part will receive the experimental update. The probability of the experimental update is determined by the formula: x = user_id mod competition. If x = 0, then the user with id = user_id will receive an experimental update (if it is set, and the coefficient competition! = 0), otherwise it will be stanard.
This formula and coefficient apply only if an authorized user tries to request an update. In the case of an unauthorized (i.e. anonymous) user, this mechanism is not applicable, and a standard update will always be issued.
Returns:
An object that describes the current update version for a given
platform.
Example
{
'link_base': 'http://aaa.com/',
'competition': 10,
'version_exp': '2',
'version_base': '1',
'platform': 'windows',
'link_exp': 'http://bbb.com/'
}
soft/list_updates/
Returns a list of updates for all platforms or for one specific platform (Admin rights are required).
URL: https://api.server.com/api/0/soft/list_updates/
Versions:0
Method: GET
Params:
- platform - Not mandatory. Platform type. If the parameter is passed, then the method will return an update for the requested platform. Otherwise, a list of updates for all platforms.
Returns:
A list of updates
STORAGE MANAGEMENT
fileops/folder_create
Create a new folder.
URL: https://api.server.com/api/1/fileops/folder_create
Versions:1
Method: POST
Params:
path - Mandatory. The path to the new folder.
created - Not mandatory. The Unix timestamp of when the directory was created in the user’s operating system on which the client application is installed for synchronization.
modified - Not mandatory. The Unix timestamp of folder modification in the user’s operating system on which the client application is installed for synchronization.
Returns:
Metadata for the new folder. See / metadata.
Errors:
403 A folder at the specified path already exists.
fileops/folder_info/
Calculate folder size and the number of items.
URL: https://api.server.com/api/1/fileops/folder_info/
Versions:1
Method: GET
Params:
- path - Mandatory. The path to the folder about which the user wants to get info.
Returns:
size - the size of a directory.
files_count - the number of files in the directory.
folders_count - the number of folders in the directory.
Errors:
400 InvalidParameters. the value of 'path' is not the folder path.
404 NotFound. Folder not found.
fileops/precheck/
Pre-check the path whether the folders_or_files_move/copy or create_files is available or not, so the user can choose the overwrite options.
URL: https://api.server.com/api/1/fileops/precheck/
Versions:1
Method: GET
Params:
from_path - The initial path to the file or directory being moved. If this value is empty, this method will check whether “file_create” is available or not.
to_path - Required. A directory in which the move occurs.
type - Required. Defines the behavior of copying or moving.
Returns:
- "exists": True / False - whether folder/file already exists in the
to_path directory or not.
- "over_writable": True / False - if a portable folder or file already
exists in the to_path directory, and from_path or to_path directory
is related to a shared folder, it returns False. otherwise True.
- "copyable": True / False - if user's storage quota size is exceeded,
it returns False, if not - True.
Errors:
405 The path to which the transfer takes place is not a directory.
409 Attempt to transfer to the same directory.
412 FileOrFolderMoveMountPointToAnother. Attempt initiated by the
collaborator to transfer the root spherical folder to the share from
another user or to the spread created by the collaborator for other
users (namely the root spherical folder, because the root spherical
folders represent a kind of mount point, the transfer of which is
contrary to logic and common meaning)
424 An attempt to transfer a directory to a subdirectory below the tree.
This portable directory is the parent of a relatively new directory
where the transfer is performed. Cannot transfer parent node to
descendant node
fileops/move/
Move a specific file or folder to a new directory. At the same time, file versions are not moved as relative versions, the operation looks like creating files in a new location and deleting the old ones.
URL: https://api.server.com/api/1/fileops/move/
Versions:1
Method: POST
Params:
from_path - Mandatory. The initial path to the file or directory being moved.
to_path - Mandatory. The directory in which the move occurs
overwrite - Optional. (By default it is False). If a portable folder or file already exists in the to_path directory and the overwrite parameter is set to False, an http exception with the code 403 will be thrown.
Returns:
Data about the moved object (with the updated path).
Errors:
400 One of the required parameters is not specified.
403 If the overwrite parameter is set to False, and a portable folder or
file already exists in the to_path directory.
404 Either the path to be moved was not found, or the directory to which
to move was not found.
405 The path to which the transfer takes place is not a directory.
409 Attempt to transfer to the same directory.
412 FileOrFolderMoveMountPointToAnother. Attempt initiated by the
collaborator to transfer the root spherical folder to the share from
another user or to the spread created by the collaborator for other
users (namely the root spherical folder, because the root spherical
folders represent a kind of mount point, the transfer of which is
contrary to logic and common meaning)
412 FileOrFolderOverwriteMountPointToAnother. Attempt to overwrite
shared folder with folder or overwrite folder with shared folder.
424 An attempt to transfer a directory to a subdirectory below the tree.
This portable directory is the parent of a relatively new directory
where the transfer is performed. Cannot transfer parent node to
descendant node
501 Unrealized functionality.
Notes:
It should be borne in mind that if the path "which is portable" can be both a file and a directory, then the path "where we can transfer" can only be a directory. There are a number of collisions that should be kept in mind when using this API method.
If during the transfer of a file or directory (for example, / a / b / c / something) it appears that an object with a similar name (i.e. something) already exists in the directory where the transfer takes place, then the object will be called something after the transfer (1) and lie on the same level with the existing object something. It should be borne in mind that in the case of a similar situation on the desktop-client, usually, the operating system offers to combine or replace files. Because In this API method, something like this is quite problematic to implement, then it is assumed that in the case of this kind of collisions the desktop client will call not this method, but a group of methods of substitutes, for example, / files / create + / fileops / delete (deleting a file on " the old "place, creating a file in the" new "place).
When moving one folder to another, an automatic collaboration of a part of collaborators may occur. So, for example, there is a folder / 1, thrown by user A, / 1/2/3/4/5, thrown at user B, and a folder / 1/2/3/6, thrown by the same user B. When Owner C ( or the collaborator A) moves the folder / 1/2/3/4 to the folder / 1/2/3/6, then the collaborator B is automatically expelled from the folder / 1/2/3/4/5 (since folder / 1/2/3/6 is available).
It should also be noted that 3 types of events are typical for the API-method of movement: 1. moved, 2. created (if the source folder is not available to the collaborator) and 3. deleted (if the destination folder is not available to the collaborator).
fileops/copy/
Copies a selected file or folder to a new or the same directory. In this case, the versions of the copied files are not copied.
URL: https://api.server.com/api/1/fileops/copy/
Versions:1
Method: POST
Params:
from_path - Mandatory. The initial path to the file or directory being moved.
to_path - Mandatory. The directory in which the move occurs.
overwrite - Optional (default is False). If a portable folder or file already exists in the to_path directory and the overwrite parameter is set to False, an http exception with the code 403 will be thrown.
Returns:
Data about a new file or a folder
Errors:
400 One of the required parameters is not specified.
403 If the overwrite parameter is set to False, and a portable folder or
file already exists in the to_path directory.
404 Either the path to be moved was not found, or the directory to which
to move was not found.
405 The path to which the transfer takes place is not a directory.
424 An attempt to transfer a directory to a subdirectory below the tree.
This portable directory is the parent of a relatively new directory
where the transfer is performed. Cannot transfer parent node to
descendant node
Notes:
If, when copying a file or directory (for example, / a / b / c / something), it is found that an object with a similar name (ie something) already exists in the "where to copy" directory, then the new object will be called something (1 ) and lie on the same level with the existing something object. It should be borne in mind that in the case of a similar situation on the desktop client, the operating system usually suggests combining or replacing files. Since something similar is quite problematic to implement in this API method, it is assumed that in case of such collisions the desktop client will call not this method, but other substitute methods, for example, / files / create (overwriting the file in a "new" place ). The operation generates only events such as "file creation" or "folder creation".
metadata/<path>
Return file or folder metadata.
URL: https://api.server.com/api/1/metadata/<path>
Versions:1
Method: GET
Params:
hash : Not mandatory. The hash parameter will be returned at each request to /metadata in the body of the answer. This value should be transferred with further /metadata calls. If the file or folder metadata has not changed since the previous call, the status 304 (Not Modifed) will be returned instead of a complete answer, which is potentially rather cumbersome. This parameter is ignored if the path points to a file or listing = false. The hash for the shared folder will be the same for all collaborators.
listing : Not mandatory. The default value is true. If true, metadata is returned for the folder, as well as a listing of the contents, including metadata for each list item. If false, the content is not returned.
dirs_only : Not mandatory. The default value is false. If true, only folders will be included in the list when listing = true.
deleted : Not mandatory. The default value is false. If true, deleted objects will be included in the list; if false, they will not.
version : Not mandatory. The specific version of the file for which metadata must be provided. Since versioning is not supported for directories, this parameter is ignored for them. If not specified, then the latest (current) version of the file is used.
extra : Not mandatory. The default is true. Together with metadata it returns some additional information - the so-called extra data. Namely - mp3 tags (if the file is in mp3 format), information about the preview (if the file is a document), information about thumbnails of pictures (if the file is an image), etc. Format see CL-1558.
offset : Not mandatory. The default value is 0. The offset from the beginning in the listing of the contents of the folder.
limit : Not mandatory. The default value is 0. The maximum number of objects returned when listing a folder.
order_by : Not mandatory. The default value is 'name'. Indicates the need to sort the result by the specified field. The possible values: 'name', '-name', 'modified_time', '-modified_time'.
Returns:
Metadata for a file or a folder, depending on what the parameter path indicates. If it is a path to the folder and the list parameter is set to True, the metadata contains this folder listing as well as metadata for each object on the listing. Besides, the header ETag contains the object hash. This hash can be used for a cache on the client side when sending it to the server in the If-None-Match header. If the object on the server has not changed, the answer will contain an empty message with 304 code.
Description of returned values:
size: File size in the format common for users. Folders will always have "0 bytes".
bytes: File size in bytes. Folders always have 0.
checksum: The file checksum (md5).
folder: Flag that indicates if it is a folder or a file.
path: A path to a folder or a file, starts with с /. If the root folder metadata are requested, the value is"/".
shared: The flag indicates if a folder is shared or not.
shared_hash: Folder hash. The parameter is important if a folder is shared for an anonymous user.
public_link: A public link to a folder or a file, if it is absent, the value equals to false.
deleted: The flag indicates if the object is deleted or not.
version: The current file version. For folders it is always 0.
hash: Folder hash that is used for subsequent calls of /metadata. It is not returned or files.
thumbnail: If a file has a generated thumbnail, it is a path to the thumbnail. If the thumbnail is not generated, it equal to false.
icon: An icon for a given file type (for files that do not support thumbnails).
modified: Date when a file or a folder was last modified.
owner: userid of the file or folder owner.
owner_name: The name of the file o folder owner.
author: userid of the file (or of the given file version) author or of a folder author.
author_name: The name of the file (or of the given file version) author or of a folder author.
author_lang: Optional. This is an interface language (allowed values are “en", "ru", "de").
client_data: Data that are installed by one of the client apps to send them to other clients.
fs_type: File system type associated with the folder. If an object is not a folder or a mount point, this field is not displayed.
is_last_page: If true, it means that this is the last results page in the folder listing, if false - there are more pages.
Errors:
304 The content of the folder has not changed since the last request
(determined by the If-None-Match header).
404 File or Folder not found.
Example
.. code-block:: json
{
"size" : "123.4KB",
"bytes" : 126362,
"checksum": "0123456789ABCDEF0123456789ABCDEF",
"version" : 1,
"modified" : 1234567890,
"path" : "/files/somefile.txt",
"icon" : "text",
"mime_type" : "text/plain",
"thumbnail" : false,
"folder" : false,
"deleted" : false,
"version": 2,
"client_data": {
"created": 1373663664,
"modified": 1373663665
}
}
metadata_full_listing/
Creates a task and returns a URL to download the file system tree.
URL: https://api.server.com/api/1/metadata_full_listing/
Versions:1
Method: GET
Params:
- listing_request_id: task identifier. Optional. If it’s not set or set with the empty value, the task will be created on the server to build the full file tree list and return the identifier of the task. If the task identifier is set, the file download URL and the task result will be returned.
Returns:
listing_request_id: task identifier if the parameter listing_request_id is not specified or empty.
url: the link if the parameter listing_request_id is specified.
Errors:
404 Incorrect query ID. Or the query data are not ready yet. If the task
has been started, the answer text will contain the info about its
progress.
{ "progress": 56 }
Note:
After the task to create the file tree list is completed on the server, the client receives a notification about it. The notification type is metadata_full_listing and looks as follows.
.. code-block:: json { "owner_name": "dmitry2@dmitry.com", "deleted": false, "timestamp": 1386074918397, "path": "", "id": "529dd326eae19d648bd65771", "init_event_user_id": 11, "user_id": 11, "init_event_user_name": "dmitry2@dmitry.com", "request_id": "", "listing_request_id": "7d88cf5e", "type": "metadata_full_listing", "owner_id": 11 }
Important: The field listing_request_id should coincide with the previous identifier listing_request_id received from the API /metadata_full_listing/. After that, the client has to make a query to the API method /metadata_full_listing/ to receive the URL to the file tree listing.
Example
{
"url" : "<direct URL to JSON with listing>",
}
files/download_as_archive/
Collects folders and files into an archive. The duration of the
operation depends on the number of added files, therefore it is
necessary to periodically interrogate API on the fact of the result.
Task readiness must be requested at
<https://api.server.com/api/1/task/<taskid>/>
URL: https://api.server.com/api/1/files/download_as_archive/
Versions:0,1
Method: GET
Params:
path=/1/2/3&path=/1/2/4 - Mandatory. An array of file and folder paths to be added to the archive.
parent_folder=/1/2 - Not mandatory. The folder in which the user is located during the request for archive creation.
Returns:
Task ID.
Errors:
403 Access to files is restricted.
Example
{
"taskid": "c10ad5ba1573d24d473a520ad4d5dfececa466b6a78cbbb2c54ad5fd83aa43e7d97b5f3d3e6d989aa39a728e1d0f7347068c92f6d055fa54becd4d3cd71782de"
}
Response from https://api.server.com/api/0/task/<taskid>/ :
{
'url': '
files/download_as_archive_stream/
Create private (current user) link folders and files for download.
URL: https://api.server.com/api/1/files/download_as_archive_stream/
Versions:0,1
Method: POST
Parameters:
path - Mandatory. A set of paths to folders and files that will be added to an archive. Example: path=/1/2/3&path=/1/2/4
parent_folder - Optional. The folder opened by a user at the time point when a request for archive creation was received.
Returns:
{
"url": "
files/progress_download_streams/<private_hash>
Check progress of currently downloaded streams.
URL: https://api.server.com/api/1/files/progress_download_streams/<private_hash>
Versions:0,1
Method: GET
Returns:
{ 'private_hash': string, 'progress': <0.0-100.0>, # in percents 'status': <'created' | 'in_progress' | 'completed' | 'error'>, 'label': string with info about stream, 'modified': string ISOFORMAT of modified 'created': string ISOFORMAT of modified }
or list sorted by field 'created'
[ { 'private_hash': string, 'progress': <0.0-100.0>, # in percents 'status': <'created' | 'in_progress' | 'completed' | 'error'>, 'label': string with info about stream, 'modified': string ISOFORMAT of modified 'created': string ISOFORMAT of modified },.. ]
files/download_as_archive_stream/
Create a zip stream of archived folders and files.
URL: https://api.server.com/api/1/files/download_as_archive_stream/
Versions:0,1
Method: GET
Parameters:
path - Mandatory. A set of paths to folders and files that will be added to an archive. Example: path=/1/2/3&path=/1/2/4
parent_folder - Optional. The folder opened by a user at the time point when a request for archive creation was received.
Returns:
Stream Http Response for zip file. Attachment has name
'<folder>_<datetime with tz>.zip'
links/download_as_archive/<hash>/
Download the entire published folder in one archive, or individual items
selected in it. The duration of the operation depends on the number of
added files, therefore it is necessary to periodically interrogate API
on the fact of the result.
Task readiness must be requested at
https://api.server.com/api/0/task/<taskid>/
URL: https://api.server.com/api/1/links/download_as_archive/<hash>/
Versions:0,1
Method: GET
Params:
hash - Mandatory. The hash of the published node, a kind of ID by which the node is searched.
path=/1/2/3&path=/1/2/4 - Mandatory. An array of file and folder paths to be added to the archive.
parent_folder=/1/2 - Not mandatory. The folder in which the user is located during the request for archive creation.
Returns:
Task ID
Errors:
403 Link blocked due to complaint about non-licensed content
Example
{
"taskid":
"c10ad5ba1573d24d473a520ad4d5dfececa466b6a78cbbb2c54ad5fd83aa43e7d97b5f3d3e6d989aa39a728e1d0f7347068c92f6d055fa54becd4d3cd71782de"
}
Example response from
[https://api.server.com/api/0/task/\<taskid\>/](https://api.server.com/api/0/task/%3Ctaskid%3E/%3E)
:
{
'url': 'some address'
}
links/download_as_archive_stream/<hash>/
Download the whole shared folder or some selected items as an archive zip in a stream.
URL: https://api.server.com/api/1/links/download_as_archive_stream/<hash>/
Versions:0,1
Method: GET
Parameters:
hash - Mandatory. A hash of the published node. This is some kind of ID used to search for the node.
path - Mandatory. A set of paths for files and folders to be added to the archive. Example: path=/1/2/3&path=/1/2/.
parent_folder - Optional. The folder opened by a user at the time point when a request for the archive creation came. Example: parent_folder=/1/2.
Returns:
Zip Archive
Errors:
403 A link was blocked due to a copyright violation complaint.
links/add_to_storage/<hash>/
Add a published folder or file to its storage. The duration of the
operation depends on the number of added files, therefore it is
necessary to periodically interrogate API on the fact of the result.
Task readiness must be requested at
https://api.server.com/api/0/task/<taskid>/
URL: https://api.server.com/api/1/links/add_to_storage/<hash>/
Versions:0,1
Method: GET
Params:
hash - Mandatory. A hash of the published node. This is some kind of ID used to search for the node.
target_path - Not mandatory. Target folder for copying.
Returns:
Task ID.
Errors:
402 There is not enough space to move the object.
403 Link blocked due to a complaint about a non-licensed content
Example
{
"taskid":
"c10ad5ba1573d24d473a520ad4d5dfececa466b6a78cbbb2c54ad5fd83aa43e7d97b5f3d3e6d989aa39a728e1d0f7347068c92f6d055fa54becd4d3cd71782de"
}
Example response from
https://api.server.com/api/0/task/\<taskid\>/
{
"folder_name": "/пингвины",
"files_count": 185,
"size": 8014617
}
files/create/
Returns the parameters necessary for uploading the file to the server.
URL: https://api.server.com/api/1/files/create/
Versions:1
Method: POST
Params:
path - Mandatory. Path to a file.
overwrite - Not mandatory. The flag is False by default. If the parameter is set to True, and a file with a similar name already exists on the server, the existing file will be overwritten. If the parameter is set to False and the file with the same name exists on the server again, the method will return an error with code 409. Presumably, for the PC client, this parameter will always be set to False, and for the web client, it will always be True.
version - Not mandatory. The number of the previous version of the file. It can be used to ensure the correct update order of the file if the current version of the file on the server does not match the specified one, the method will return an error.
create_dirs - Not mandatory. Default is True. If the parameter is set to False, the system will not create missing folders for creating the file.
created - Not mandatory. Unix timestamp of the time the file was created in the user's operating system (in milliseconds) on which the client application for synchronization is installed.
modified - Not mandatory. Unix timestamp of file modification time in the user's operating system (in milliseconds) on which the client application for synchronization is installed.
device_id - Not mandatory. The ID of the device with which the file was downloaded.
device_reference - Not mandatory. An auxiliary field for storing a file link in the local storage of the device of the API initiator.
size - Not mandatory. The size of the created file. This parameter is used to deduplicate and verify the correct upload of the file.
checksum - Not mandatory. The checksum (md5) from the contents of the file. Used to deduplicate and verify the correct upload of the file.
multipart - Not mandatory. The default flag is False. If True, then multipart upload is initiated. Multipart upload is performed using the PUT method on the URL with the possibility of specifying additional headers, parameters as in the POST request are not used.
Returns:
url - The link to which the file or its first part in case of using multipart upload is sent;
parameters - Additional parameters of the POST request (not used when sending by the PUT method in multipart upload).
headers - Additional HTTP headers. When using a POST request, these headers are simply added to the parameters dictionary;
confirm_url - link to the confirmation of the end of the file upload;
temp_path - it is returned only if a multipart upload is used, it is used when upload parameters of other parts of the file are received.
If deduplication works, the method returns the same as the / metadata / <path> method.
Errors:
201 The file was created as a result of deduplication, i.e. a file with
the same size and checksum was already on the server. The response body
will be the same as the / metadata / <path> method returns..
400 Invalid version of the file.
403 An attempt to write to a remote folder or the file version does not
match when overwriting it.
404 An attempt was made to write to a missing folder if the create_dirs
flag is False.
409 A file name conflict with an existing object if overwrite is False.
files/create_part/
Returns the parameters necessary for uploading file parts to the server when using multipart upload.
URL: https://api.server.com/api/1/files/create_part/
Versions:0,1
Method: POST
Params:
temp_path - Mandatory. The path that the / files / create / method returned when the multipart upload was initiated;
part_num - Mandatory. A number of upload part of the file.
Returns:
url - link to which the file is sent using the PUT method;
parameters - An empty list, not used for the multipart upload;
headers - Additional HTTP headers.
Errors:
404 The specified temp_path does not exist, probably multipart upload
was not initiated using the / files / create / method
files/confirm/<path>
Confirms a successful file upload to S3.
URL: https://api.server.com/api/1/files/confirm/<path>
Versions:1
Method: POST
Params:
user_id - Mandatory. User ID.
temp_name - Mandatory. Temporary file name
overwrite - Not mandatory. The flag is False by default. If the parameter is set to True, and a file with a similar name already exists on the server, the existing file will be overwritten.
version - Not mandatory. The number of the previous version of the file.
size - Not mandatory. The size of the created file is used to verify the accuracy of the file upload.
checksum - Not mandatory. The checksum (md5) from the contents of the file. Used to verify the accuracy of the file upload.
Returns:
Metadata for the uploaded file. See / metadata.
Errors:
403 Invalid file version.
404 The specified file not found.
409 The object (a folder or a file) already exists at the requested
path, but only if the overwrite parameter is set to False.
files/multi_confirm/
The asynchronous API method for confirmation of a successful upload of multiple files to storage.
URL: https://api.server.com/api/1/files/multi_confirm/
Versions:1
Method: POST
Parameters:
- confirm_urls: A list of confirming URLs taken from the files/create/ API method.
Returns:
Task identificator:
.. code-block:: js
{ "taskid": "c10ad5ba1573d24d473a520ad4d5dfececa466b6a78cbbb2c54ad5fd83aa43e7d97b5f3d3e6d989aa39a728e1d0f7347068c92f6d055fa54becd4d3cd71782de" }
files/get/<path>
Returns the parameters to get the contents of the file.
URL: https://api.server.com/api/1/files/get/<path>
Versions:1
Method: GET
Params:
version - Not mandatory. File version. By default, the latest version is used.
for_view - Not mandatory. Indicates for what purpose the download link is required: viewing (streaming) - True or downloading
- False, for the first case Content-Type is set, for the second case Content-Disposition, the default value is False.
deleted - Not mandatory. if True - give a link to download if the file is deleted, if False - give 404 if the requested file is deleted.
Returns:
An object containing information about the downloaded file.
Errors:
404 File not found
403 Access to files is restricted
Example
{
"url" : "direct URL file on S3",
"path" : "/folder/filename.ext",
"deleted" : false,
"method" : "GET",
"version": 2,
"size": 100500,
"checksum": "<md5 for contents of file or null>",
"created": 1234534545,
"modified": 1678903454,
"client_data": {}
}
files/favorites/
Returns the files set as favorites by the user.
URL: https://api.server.com/api/1/files/favorites/
Versions:1
Method: GET
Returns:
Metadata of files marked as favorites. Returns as a list.
fileops/set_favorite/
Changes the file or folder’s favorite status
URL: https://api.server.com/api/1/fileops/set_favorite/
Versions:1
Method: POST
Params:
- path - Path of the file to toggle favorite status.
Returns:
Metadata of the changed object
fileops/purge/
Cleans up deleted files and file versions.
URL: https://api.server.com/api/1/fileops/purge/
Versions:1
Method: POST
Params:
no params
Returns:
200 If the operation to clean up deleted files and their versions has
been queued.
fileops/purgestatus/
Returns the status of the task to clean user files.
URL: https://api.server.com/api/1/fileops/purgestatus/
Versions:0,1
Method: POST
Returns:
The status of the task to clean user files.
Example
{
"status": "PROCESSING"
}
files/versions/<path>
Returns the file versions list. The versions are sorted recursively from the creation date, the first version is the current one.
URL: https://api.server.com/api/1/files/versions/<path>
Versions:1
Method: GET
Params:
skip - Not mandatory. The initial offset of the records. It allows you to organize pagination.
limit - Not mandatory. Limit on the number of entries.
extra - Not mandatory. Add extra data to the information about each version of the file.
Returns:
An array of objects describing the version of the file.
Errors:
404 The specified file was not found.
Example
[
{
"id": "4f763d57291f40102c0000ba"
"content": {
"size": 129024
},
"version": 1,
"type": "from_diff",
"timestamp": 1339663686.485451,
"restored_timestamp": 1339663824.485451
}
]
The parameter restored_timestamp # The Unix timestamp for the restored file version is the UTC (timestamp) of the file version that has been restored.
files/versions_to_update/
Returns a list of file versions sorted in ascending order to update the file on the client to the latest version.
URL: https://api.server.com/api/1/files/versions_to_update/
Versions:0,1
Method: GET
Params:
path - Mandatory. The path to the file.
version - Mandatory, int, The current version of the file on the client.
Returns:
An array of objects describing the version of the file.
Errors:
404 The specified file could not be found.
Example
[
{
"content": {
"size": 129024
},
"diff": {
"size": 67649
},
"version": 1,
"type": "from_diff",
"id": "4f763d57291f40102c0000ba"
}
]
Each element of this array is a certain version of the file.
type - type of version (see / files / versions / method).
diff - it can either be null or not (if not null, it means that this version was obtained through diff).
content - file version information.
Example: a client requests all versions of a certain file starting from the 0, but the content for a given file was updated entirely through the files / create method (via the web interface) to the 3rd version and starting from the 3rd through diff-functionality. Then this method will return version information starting from the 3rd, as it is assumed that to update the client, you should return version information starting from the last created version and not through the diff-functionality.
files/restore/
Restores the specified version of the file, a new file version appears.
URL: https://api.server.com/api/1/files/restore/
Versions:1
Method: POST
Params:
path - Mandatory. The path to the file.
version - Mandatory. Version number.
Returns:
The file metadata with the restored version file.
Errors:
404 The specified file or version was not found.
fileops/delete/
Delete a file or a folder.
URL: https://api.server.com/api/1/fileops/delete/
Versions:1
Method: POST
Params:
path - Mandatory. The path to the folder or file to be deleted.
only_empty - Not mandatory. The default value is false. If true, then the folder will be deleted only if it is empty. When you delete a file this parameter is not used.
without_trash - Not mandatory. The default value is false. If true, then the object will be deleted without moving to the trash.
Returns:
Remote folder metadata. See / metadata.
Errors:
403 The user is not allowed to delete this folder or it is not empty if
the only_empty parameter is true.
404 The specified folder was not found.
fileops/multi/delete/
Delete several files or folders.
URL: https://api.server.com/api/1/fileops/multi/delete/
Versions:1
Method: POST
Params:
path=/1/2/3&path=/1/2/4 - Mandatory. A list of paths to the folders or files that need to be deleted.
only_empty - Not mandatory. The default value is false. If true, then the folders will be deleted only if they are empty. When you delete a file this parameter is not used.
without_trash - Not mandatory. The default value is false. If true, then the objects will be deleted without moving to the trash.
Returns:
List of metadata of deleted folders or files. See / metadata.
Errors:
403 The user is not allowed to delete this folder or it is not empty if
the only_empty parameter is true.
404 The specified folder was not found.
Example
{"success":10,
"failed": 2,
"nodes": [{
"path" : "/files/somefile1.txt",
"icon" : "text",
...
"error_code": null
},{
"path" : "/files/somefile2.txt",
"icon" : "text",
...
"error_code": null
},...,{
"path" : "/files/somefile3.txt",
"error_code": 404
}]}
fileops/undelete/
Restore a deleted file or folder.
URL: https://api.server.com/api/1/fileops/undelete/
Versions:1
Method: POST
Params:
- path - Mandatory. The path to the folder or file to be restored.
Returns:
Metadata of the restored folder. See / metadata.
Errors:
403 The user is forbidden to restore this file or folder (because it is
not deleted, or is part of some deleted parent object, i.e. for example,
you cannot restore a previously deleted file from a folder that was
deleted later than this file).
404 The specified folder was not found.
fileops/multi/undelete/
Restore several deleted files or folders.
URL: https://api.server.com/api/1/fileops/multi/undelete/
Versions:1
Method: POST
Params:
- path=/1/2/3&path=/1/2/4 - Mandatory. A list of paths to the folders or files to be restored.
Returns:
They are specified for each path in the field error_code in the answer
text.
Errors:Are indicated in the field error_code for each file/folder
in the answer text.
403: A user is not allowed to restore the file or the folder (the folder
was not deleted or it is a part of some deleted parent object.) For
example, it is impossible to restore a file deleted from a folder that
was deleted later than this file.
404: The specified folder is not found.
Example
{
"success":10,
"failed": 2,
"nodes": [{
"path" : "/files/somefile1.txt",
"icon" : "text",
...
"error_code": null
},{
"path" : "/files/somefile2.txt",
"icon" : "text",
...
"error_code": null
},...,{
"path" : "/files/somefile3.txt",
"error_code": 404
}]
}
fileops/rename/
Rename a file or a folder.
URL: https://api.server.com/api/1/fileops/rename/
Versions:1
Method: POST
Params:
path - Mandatory. The path to the file or folder.
newname - Mandatory. A new name.
Returns:
Metadata of the renamed object. See / metadata.
Errors:
404 The specified file or folder was not found.
Note:
Renaming a file or folder occurs as follows: a folder (or file) with the former name is deleted, and a file or folder with a new name is created.
shares/add/
Sends an invitation to a shared folder to another user. If a collaborator with such member_email does not exist, the system creates a new inactive user with the given email and sends a message to this email notifying that some user shared a folder and a new user has to register to get access to this folder. The message contains a link with the invite hash. Using this invite hash (the method /accounts/create) a user can register without having to confirm the registration by email. When the user follows the link, the user automatically agrees to get access to the shared folder.
URL: https://api.server.com/api/1/shares/add/
Versions:1
Method: POST
Parameters:
path - Mandatory. A path to a folder.
member_login - Optional. A login of a user who needs access to the folder. If the parameter is not specified the access is granted so that all users can accept the invitation.
writer - Optional. If a user has the right to create objects in a folder. By default, set to False.
invitation - Optional. An invitation text that will be sent to a user.
public_view - Optional. Grants reading access to all users via the invitation hash. By default, set to False. The reading access for all disappears after an invitation is accepted or denied.
group_id - Optional. The identifier of the group for which a folder should be shared. If the group_id is specified the member_login is ignored.
lang: Optional. This is an email language (allowed values are "en", "ru", "de",etc).
- use_folder_limit - Optional. folder size limitation is
enabled or not if a shared folder uses a folder limit feature.
- folder_limit - Optional. folder size limitation if a shared folder uses a folder limit feature.
- use_folder_limit - Optional. folder size limitation is
enabled or not if a shared folder uses a folder limit feature.
Returns:
A unique token of an invitation to a shared folder.
Errors:
403 The folder cannot be shared.
404 The folder not found
409 The user is trying to share the folder to himself.
424 Attempting to share a folder that contains the root shared folder
from another user among its descendants down the tree (you must prohibit
sharing such folders, because there could be a vulnerability, for
example, user A shared the folder to user B, and that in turn moved the
corresponding root shared folder inside its file tree, and shared its
own top-level folder to user C. Thus, without the knowledge of user A,
user C can have access to the files and folders of user A.
Note:
If the folder has already been shared with the collaborator, 200 OK is returned with an empty response body.
Example
{
"hash" : "ee977806d7286510da8b9a7492ba58e2484c0ecc"
}
shares/remove/
Remove a user from a shared folder.
URL: https://api.server.com/api/1/shares/remove/
Versions:1
Method: POST
Params:
path - Mandatory. The path to the folder.
member_login - Mandatory. Login of the user to be deleted from the shared folder.
Returns:
200 If the user has been deleted from the shared folder.
Errors:
403 If the user is not a collaborator of the folder.
404 If the folder is not found.
shares/accept/
Accepts an invitation to the shared folder. The user has a new folder in
the root. If the collaborator already has a folder with that name, then
a serial number will be added to the new folder. The maximum number is
10.
The collaborator can rename his folder and this does not affect the
folder name of other collaborators.
URL: https://api.server.com/api/1/shares/accept/
Versions:1
Method: POST
Params:
- hash - Mandatory. The unique hash of the user’s invitation to the shared folder obtained by calling the / folders / shared / add / method.
Returns:
200 If the folder has been shared
Errors:
403 The hash does not indicate a folder shared with this user.
shares/decline/
Decline an invitation to a shared folder.
URL: https://api.server.com/api/1/shares/decline/
Versions:0,1
Method: POST
Params:
- hash - Mandatory. The unique hash of the user’s invitation to the shared folder obtained by calling the / folders / shared / add / method.
Returns:
200 If the invitation was declined successfully.
Errors:
403 The hash does not indicate a folder shared with this user.
shares/uninvite/
Takes back an invitation to share a folder from a collaborator or a
group. If you specify the group,
the parameter member_login will be ignored.
URL: https://api.server.com/api/1/shares/uninvite/
Versions:1
Method: POST
Parameters:
path - Mandatory. A path to a folder.
member_login - Optional. A unique ID of the user to take an invitation from. If the parameter is not specified the access is taken back from all users.
group_id - Optional. The group identifier. If the group identifier is specified, the parameter member_login will be ignored.
Returns:
200 If the invitation was taken back successfully.
Errors:
403 If the invitation cannot be taken back (for example, it has already
been accepted).
shares/unshare/
Cancels access to a folder and deletes all collaborators. The folder disappears in all collaborator's accounts.
URL: https://api.server.com/api/1/shares/unshare/
Versions:0,1
Method: POST
Params:
- path - Mandatory. The path to the shared folder.
Returns:
200 If the cancellation is successful.
Errors:
404 The shared folder at the specified path was not found.
shares/collaborators/
Returns a collaborators list of a shared folder.
URL: https://api.server.com/api/1/shares/collaborators/
Versions:1
Method: GET
Params:
- path - Mandatory. The path to the folder.
Returns:
An array of collaborators.
Errors:
404 If the folder was not found.
Example
{
"owner": false,
"writer": true,
"status": "accepted",
"userid": 11,
"login": "userid:11",
"name": "Валентин Родыгин",
"is_indirect": false
}
Notes:
is_indirect - indirect or direct Collaborator for the shared folder;
False is direct. This folder was shared with Collaborator;
True is indirect. The parent folder was shared with Collaborator;
shares/update_collaborator/
Updates collaborator access rights to a directory shared with him.
URL: https://api.server.com/api/1/shares/update_collaborator/
Versions:1
Method: POST
Parameters:
path: Mandatory. A path to a folder.
member_login: Mandatory. A login of a user who was granted access to a shared folder.
writer: Mandatory. Can be True or False. Provides writing rights or not.
group_id - Optional. The identifier of the users who were granted access to the shared folder. If the member_login is specified, the group_id parameter will be ignored.
Returns:
200 If an update was successful.
Errors:
403 If the folder is not shared.
404 If the folder is not found.
shares/
Returns a list of shared folders.
URL: https://api.server.com/api/1/shares/
Versions:1
Method: GET
Parameters:
- whoose - Possible values:
* my - return owners folders only
* others - returns folders shared by other users with my collaboration
* company - returns folders shared and published in user's company
* no value - returns all shared folders (users and others)
Returns:
A metadata list for each folder.
shares/sizelimit/
Sets the folder size limit.
URL: https://api.server.com/api/1/shares/sizelimit/
Versions:1
Parameters:
path: Mandatory. Folder path.
owner_id: Mandatory. Folder owner id.
size_limit: Folder limit size.
enable: Enable folder size limit. Boolean.
Errors:
400 Current folder size is bigger than limited value
401 unauthorize
shares/company/add/
Add folder to the company's public shares list of the current user. Method work is for the current user.
URL: https://api.server.com/api/1/shares/company/add/
Versions:1
Parameters:
path - mandatory, folder path
public_name - a public name for a folder, folder name used by default.
Returns:
A Map of elements:
owner_id - share owner identifier
public_name - share name
folder_hash - hash value to share folder to others
Errors:
403 Forbidden to share folder for users from another company
shares/company/hide/
Remove folder from the company's public shares list. The method works for the current user.
URL: https://api.server.com/api/1/shares/company/hide/
Versions:1
Parameters:
Any parameter of:
folder_hash - folder public hash
path - folder path
Returns: None
Errors:
404 Folder not found in company folders list
shares/company/get/
Returns shared folders list. The method works for the current user.
URL: https://api.server.com/api/1/shares/company/get/
Versions:1
Parameters:
folder_hash - the hash of the published folder
offset - the set amount of records to skip
limit - The maximum amount of records to return
show_all -not mandatory, a flag to show all company folders (only for companies admin)
Returns:
A list of maps:
owner_id - share owner identifier
public_name - share name
folder_hash - hash value to share folder to others
owner_name - Folder owner's name
collaborators_count - collaborators count
modification_time - last modification time
status - folder status:
waiting - current user invited to a folder
requested - access to the folder requested by the current user
accepted - a current user has access to this folder
path - folder path, not empty only if the current user is owner or folder shared for him.
shares/company/get/one/
Returns shared folders info by folder_hash. The method works for the current user.
URL: https://api.server.com/api/1/shares/company/get/(?P<folder_hash>[a-zA-Z0-9-_!]+)/
Versions:1
Parameters:
- folder_hash - hash of the published folder
Returns:
A map of:
owner_id - share owner identifier
public_name - share name
folder_hash - hash value to share folder to others
owner_name - Folder owner's name
collaborators_count - collaborators count
modification_time - last modification time
status - folder status:
waiting - current user invited to a folder
requested - access to the folder requested by the current user
accepted - a current user has access to this folder
path - folder path, not empty only if the current user is owner or folder shared for him.
shares/company/shared/
Returns list of already shared folders and public links, for company admins only.
URL: https://api.server.com/api/1/shares/company/shared/
Versions:1
Parameters:
name - user name for the filter. For all users by default.
offset - Not required. By default is equal to 0. Start of shared list results.
limit - Not required. By default is equal to 0. Amount of items in shared list results
Returns:
List of maps. Each map element contains:
bytes - the size of the file
creation_time - share creation timestamp
modification_time - file modification timestamp
owner_id - share or link owner's identifier
owner_name - share or link owner's name
shared_outside - For the published folder, there is the flag is True if one of the collaborators or owner not from a company. For link is always True.
src_path - File or folder path
type - what kind of stuff is it. 'share' - for published folders and 'link' - for links.
If set offset and limit, it will return result with twice of limit
Example
[{
u'bytes': 0,
u'creation_time': 1409902069540,
u'modification_time': 1409902069855,
u'owner_id': 4,
u'owner_name': u'user3',
u'shared_outside': True,
u'src_path': u'/user3_folder1',
u'type': u'share'
}]
shares/company/request/
Send an access request to the public folder owner.
URL: https://api.server.com/api/1/shares/company/request/
Versions:1
Parameters:
folder_hash - Mandatory. folder hash from company folders list response.
invitation - request description for folder owner.
Return:
No return data
Errors:
403 Folder already shared or sharing not allowed for current user
404 Folder hash or user not found
409 Folder sharing conflict, a user can't share folder for himself
shares/company/accept/
Accept the folder sharing request.
URL: https://api.server.com/api/1/shares/company/accept/
Versions:1
Parameters:
folder_hash - mandatory, folder hash from company folders list response.
writer - Write rights for the folder (True or False), Read-only by default
Returns:
No return data
Errors:
403 Folder not shared or sharing not allowed for the current user
404 Folder hash or user not found
shares/company/requests/
Returns a list of company share access requests.
URL: https://api.server.com/api/1/shares/company/requests/
Versions:1
Parameters:
None
Returns:
List of share information
Errors:
403 Folder not shared or sharing not allowed for the current user
404 Folder hash or user not found
Example
{
'owner_id': owner.userid,
'owner_name': owner.name,
'directory_name': path value,
'writer': write access rights,
'hash': hash value
}
shares/invites/
Returns a list of invitations available to a collaborator.
URL: https://api.server.com/api/1/shares/invites/
Versions:1
Method: GET
Params:
None
Returns:
A list of pending invitations.
Example
[
{
"hash": "NNqCj79BqU8mbr6Dn2mhBnPO7sDMSF0K",
"writer": true,
"directory_name": "test_share_folder",
"owner_name": "test",
"owner_id": 1},
...
]
links/create/
Creates a public link.
URL: https://api.server.com/api/1/links/create/
Versions:1
Method: POST
Parameters:
path: Mandatory. A path to a file or a folder.
ttl - Optional. The time period during which the link is active. After this period is over, the link becomes invalid. Values are specified in milliseconds [0, 31536000]
download_max - Optional. The maximum number of link queries.
password - Optional. Limiting access to the data provided by the link. The access is limited by means of a password.
notify - Optional.
upload_folder - Flag that indicates that a file download link is being created on the server.
Returns:
Folder or file metadata. See / metadata.
Errors:
400 Attempt to create a link to the folder to upload a file.
403 Attempt to create a link to a file that doesn’t exist anymore.
404: The file or the folder is not found.
links/delete/
Deletes a public link.
URL: https://api.server.com/api/1/links/delete/
Versions:1
Method: POST
Params:
- path - Mandatory. The path to the folder or file.
Returns:
Metadata about a folder or file. See / metadata.
Errors:
404 Public link not found
links/
Returns a list of public links created by the current user.
URL: https://api.server.com/api/1/links/
Versions:1
Method: GET
Parameters:
- hash : Optional.
Returns:
An array of metadata files for which public links have been created.
Example
[
{
"created": 1337852927321,
"deleted": false,
"bytes": 271426,
"modified": 1339454394537,
"public_hash": "http://dl.server.com/1/71277d2297?public",
"version": 0,
"path": "/server_payments_1.jpg",
"folder": false,
"thumbnail": false,
"mime_type": "image/jpeg",
"icon": ""
}
]
links/get/<hash>/<path>
Output information on the published file (including URL for downloading).
URL: https://api.server.com/api/1/links/get/<hash>/<path>
Versions:0,1
Method: GET
Params:
hash - Mandatory. The hash of the published node, a kind of id by which the node is searched.
path - Not mandatory.The path to the file, regarding the published directory (i.e. if not a file is published, but the folder which contains the file)
for_view - Not mandatory. Indicates for what purpose the download link is required: viewing (streaming) - True or downloading
- False, for the first case Content-Type is set, for the second case Content-Disposition, the default value is False.
Returns:
An object containing information about the downloaded file.
Errors:
404 The node was not found. Possible reasons: path is incorrectly set,
the node has ceased to be published, or has been deleted.
403 The link was blocked due to a complaint about non-licensed content.
links/metadata/<hash>/<path>
Output information on the published node, regardless of whether it is published separately or within a published directory.
URL: https://api.server.com/api/1/links/metadata/<hash>/<path>
Versions:1
Method: GET
Params:
hash - Mandatory. The hash of the published node, a kind of id by which the node is searched.
path - Not mandatory. The path to the file or folder relative to the published directory.
dirs_only - Not mandatory. The default is false. If true, only folders will be included in the list when listing = true.
extra - Not mandatory. The default is true. Together with metadata, it returns some additional information - the so-called extra data. Namely - mp3 tags (if the file is in mp3 format), information about the preview (if the file is a document), information about thumbnails of pictures (if the file is an image), etc.
offset - Not mandatory. The default value is 0. The offset from the beginning in the listing of the contents of the folder.
limit- Not mandatory. The default value is 0. The maximum number of objects returned when listing a folder.
Returns:
Metadata for a file or directory. The result returned by the method is
similar to the result of the metadata API method. The only difference is
that all paths are set relative to the published folder, and if
information about the root published folder is displayed in the JSON
result, an additional parameter name is passed containing the name of
the root published folder (because its name cannot be obtained from path
since a path in the case of the root published folder is /).
Errors:
404 The node was not found. Possible reasons: path is incorrectly set,
the node has ceased to be published, or has been deleted.
403 The link was blocked due to complaint about non-licensed content
fileops/handover/
Transfers the shared folder by the owner to one of the collaborators.
When transferring, the following actions occur:
- copying files to the collaborator storage;
- unsharing a folder at the collaborator side;
- transfer of all collaborators from the folder of the old
owner to the new folder of the new owner.
In this case, the old owner has his copy of the files.
URL: https://api.server.com/api/1/fileops/handover/
Versions:0,1
Method: POST
Params:
path - Mandatory. The path to the folder to be transferred to the collaborator.
member_id - Mandatory. The ID of the collaborator to whom the rights to the folder are transferred.
Returns:
None
Errors:
400 One of the required parameters is not set.
404 The folder to be transferred to the collaborator was not found or
the specified user does not exist.
403 The folder is not shared for the specified collaborator, or he has
not yet accepted the invitation to it.
Notes:
The process of transferring a folder is carried out in the background. For this period, the _old suffix is added to the name of the shared folder of the collaborator and the files are copied from it to a new folder with the same name as the shared folder has.
trash/
Returns a list of files and folders located in the recycle bin.
URL: https://api.server.com/api/1/trash/
Versions:1
Method: GET
Params:
dirs_only : Not mandatory. The default value is 0. If 1, only directories will be included in the list.
extra : Not mandatory. The default is true. Together with metadata it returns some additional information - the so-called extra data. Namely - mp3 tags (if the file is in mp3 format), information about the preview (if the file is a document), information about thumbnails of pictures (if the file is an image), etc. Format see CL-1558
offset : Not mandatory. The default value is 0. The offset from the beginning in the listing of the contents of the recycle bin.
limit : Not mandatory. The default value is 0. The maximum number of objects returned when listing the recycle bin.
Returns:
Metadata listing of each item in the recycle bin.
In addition, the hash of the owner recycle bin is returned in the ETag
header. This hash can be used for client-side caching by passing it to
the server in the If-None-Match header, if the recycle bin on the server
has not changed, then the code 304 and an empty body will be returned in
response.
The response format is similar to that returned by the / metadata API method. Instead of the path field in the object information, the name field is returned, which is used when restoring the object as its identifier in the recycle bin. The restore_path field is also added - the path at which the object was located before it was removed.
Errors:
304 The contents of the recycle bin have not changed since the last
request (determined by the If-None-Match header).
404 The recycle bin or object inside it was not found. For example, they
were removed during the execution of the request.
trash/restore/<name>
Recover an object from the recycle bin.
URL: https://api.server.com/api/1/trash/restore/<name>
Versions:1
Method: POST
Params:
paths : Mandatory. List of object names in the recycle bin.
overwrite : Not mandatory (default is 1). If the restored folder or file already exists in the user's repository and the overwrite parameter is set to 0, an HTTP exception code 403 will be thrown.
Notes:
The method is asynchronous
trash/clear/
Empty the trash or permanently delete files from the trash.
URL: https://api.server.com/api/1/trash/clear/
Versions:1
Method: POST
Params:
- paths: Not mandatory. A list of paths to the files to delete from the trash.
Notes:
The method is asynchronous
trash/from_shared/<path>
Returns a list with information about the files and folders located in the recycle bin. The files and folders were previously located in the shared folder.
URL: https://api.server.com/api/1/trash/from_shared/<path>
Versions:1
Method: GET
Params:
path: Mandatory. The path to the shared folder.
dirs_only : Not mandatory. The default value is 0. If 1, only directories will be included in the list.
extra : Not mandatory. The default is true. Together with metadata it returns some additional information - the so-called extra data. Namely - mp3 tags (if the file is in mp3 format), information about the preview (if the file is a document), information about thumbnails of pictures (if the file is an image), etc. Format see CL-1558
offset: Not mandatory. The default value is 0. The offset from the beginning in the listing of the contents of the recycle bin.
limit : Not mandatory. The default value is 0. The maximum number of objects returned when listing the recycle bin.
Returns:
Metadata listing of each object in the recycle bin previously belonging
to the shared folder. In addition, the hash of the owner recycle bin of
the shared folder is returned in the ETag header.
This hash can be used for client-side caching by passing it to the
server in the If-None-Match header, if the recycle bin on the server has
not changed, then the code 304 and an empty body will be returned in
response.
The response format is similar to that returned by the / metadata API method. Instead of the path field in the object information, the name field is returned, which is used when restoring the object as its identifier in the recycle bin. The restore_path field is also added - the path at which the object was located before it was removed.
Errors:
304 The contents of the recycle bin have not changed since the last
request (determined by the If-None-Match header).
400 The folder is not a shared folder of the user
404 The recycle bin or object inside it was not found. For example, they
were removed during the execution of the request.
trash/restore/<name>/from_shared/<path>
Restoring an object located in the shared folder from the recycle bin
URL: https://api.server.com/api/1/trash/restore/<name>/from_shared/<path>
Versions:1
Method: POST
Params:
name : Mandatory. The name of the item in the recycle bin.
path: Mandatory. The path to the shared folder.
overwrite : Not mandatory (default is 1). If the restored folder or file already exists in the user's repository and the overwrite parameter is set to 0, an HTTP exception code 403 will be thrown.
Notes:
The method is asynchronous
migration_contents/
Returns information about migration requests. The method works for the current user.
Parameters:
path - not mandatory, folder path
whoose - Possible values:
my - return owners folders only
others - returns folders migrated by other
no value - returns all migrated folders (users and others)
- status - not mandatory, list of statuses. Receive values: 'accepted, 'requested'. On default returns all statuses.
Returns:
A list of migration information
migration_contents/add/
Create a request for content migration from user to user.
URL: https://api.server.com/api/1/migration_contents/add/
Versions:1
Method: POST
Params:
member_login - mandatory, login for user.
path - not mandatory, folder path. By default migrate all user's files.
invitation - invitation message for content receiver.
cleanup - cleanup folder after the migration is ended
Returns:
- hash code for accepting
Example
{
"status": "requested",
"dst_path": "",
"receiver_id": 3,
"hash": "YrczzylqmvUUPScjAg",
"src_path": "",
"owner_id": 2
}
migration_contents/accept/
Accept a request for content migration.
URL: https://api.server.com/api/1/migration_contents/accept/
Versions:1
Method: POST
Params:
- hash - mandatory, the hash code for rejecting
Returns:
Information about migration
Example
{
"status": "accepted",
"dst_path": "/user2/home",
"receiver_id": 3,
"hash": "",
"src_path": "",
"owner_id": 2
}
migration_contents/reject/
Reject a request for content migration.
URL: https://api.server.com/api/1/migration_contents/reject/
Versions:1
Method: POST
Params:
- hash - mandatory, the hash code for rejecting
Returns:
None
migration_contents/remove/
Remove a request for content migration.
URL: https://api.server.com/api/1/migration_contents/remove/
Versions:1
Method: POST
Params:
- hash- mandatory, the hash code for deleting
Returns:
None
shares/collaborators/
Returns a list of collaborators for a shared folder.
URL: https://api.server.com/api/1/shares/collaborators/
Versions:1
Method: GET
Params:
userid - mandatory, shared folder owners identifier
path - mandatory, folder path.
Returns:
List of collaborators
Errors:
404 If folder not found
Example
[{
"owner": false,
"writer": true,
"status": "accepted",
"userid": 11,
"login": "userid:11",
"name": "Валентин Родыгин",
"is_indirect": false
}]
Notes:
The is_indirect parameter- indirect or direct collaborator for the
shared folder.
false - direct - this folder has been shared with the
collaborator
True- indirect - the parent folder has been shared with
the collaborator
shares/remove/
Deletes user from a shared folder.
URL: https://api.server.com/api/1/shares/remove/
Versions:1
Method: POST
Params:
userid - mandatory, shared folder owners identifier
path - mandatory, Folder path.
member_login - mandatory, User login which should be deleted from a shared folder.
Returns:
200 If the user has been removed from the shared folder.
Errors:
403 If the user is not a collaborator of the folder.
404 If the folder is not found.
shares/unshare/
Unshares folder and deletes all users from a shared folder. Folders are hidden from all collaborators.
URL: https://api.server.com/api/1/shares/unshare/
Versions:1
Method: POST
Params:
userid - mandatory, shared folder owners identifier
path - mandatory, Shared folder path.
Returns:
200 If the cancellation is successful.
Errors:
404 The shared folder with the specified path was not found.
links/file_create/<hash>
Returns parameters necessary to upload a file to the server.
URL: https://api.server.com/api/1/links/file_create/<hash>
Versions:1
Method: POST
Parameters:
hash - Mandatory. Public hash to upload the file that was created by the method links/create/
created - Optional. Unix timestamp for the time (milliseconds) when a file was created in the user operating system where the client app for synchronization is installed.
modified - Optional. Unix timestamp for the time (milliseconds) when a file was modified in the user operating system where the client app for synchronization is installed.
device_id - Optional. A device ID from which a file was uploaded.
device_reference - Optional. An auxiliary field to store a link to the file in the local device storage of the API initiator.
size - Optional. The size of the file created. The parameter is used to deduplicate and check if the file uploading is correct.
checksum - Optional. This is a checksum (md5) of the file contents which is used to deduplicate and check if the file uploading is correct.
password - Optional. If a password is required to access the created link, it is transmitted in this parameter.
multipart - Optional. By default, the flag is set to False. If True, a multipart upload is initiated. The multipart upload is executed by means of the PUT method to the URL with the possible indication of additional headers. The parameters as in the POST request are not used.
Returns:
url:A link to the file which needs to be sent or to the file's part if the multipart upload is used.
parameters:Additional parameters of the POST request (are not used when the PUT method in the multipart upload is applied).
headers:Additional HTTP headers. If using the POST request, headers are just added to the parameter dictionary.
confirm_url:A link to the address to confirm that the file uploading is finished.
temp_path:Returned if using a multipart upload only; this parameter is used to receive uploading parameters of other file parts.
If deduplication was executed the method returns the same value as the method /metadata/<path>.
Errors:
201: The file was created as a result of deduplication, i.e. the file
with the same size and checksum was already on the server. The answer
text will have the same value as the method /metadata/<path>
returns.
400: The query was built incorrectly.
402: Not enough space in the storage.
403: Not enough rights to upload the file. The used hash is available
only for download, there are limitations for the files upload with this
hash, etc.
404: Trying to upload a file to a non-existing folder.
links/file_create_part/<hash>
Returns parameters necessary to upload a file to the server.
URL: https://api.server.com/api/1/links/file_create_part/<hash>
Versions:1
Method: POST
Parameters:
hash - Mandatory. The public hash for downloading a file, it’s created by the method / create / method
temp_path: Mandatory. The path returned by the method /files/create/ when the multipart upload is initiated.
part_num: Mandatory. The number of the uploaded file part.
password - Optional. Password for the link, if needed.
Returns:
URL:A link where the file needs to be sent to by means of the PUT method.
parameters:An empty list, it is not used for the multipart upload.
headers: Additional HTTP headers.
Errors:
201 The file was created as a result of deduplication, i.e. the file
with the same size and checksum was already on the server. The answer
text will have the same value as the method /metadata/<path>
returns.
404 Trying to upload a file to a non-existing folder.
403 Insufficient permissions to upload the file. The used hash is
available only for downloading, restrictions are imposed on uploading
files by used hash, etc.
files/search/
File and directory searching in the filesystem by the query string.
URL: https://api.server.com/api/1/files/search/
Versions:1
Method: POST
Params:
query: Required. Searching query.
type :Type of search.
offset : Not required. By default, it is equal to 0. Start searching results.
limit :Not required. By default, it is equal to 0. Amount of items in searching results.
type : Type of search.
**Returns:**
.. code-block:: js
{
"content": [
{
"owner_name": "anonymous",
"created": 1429533845437,
"deleted": false,
"checksum": "cc0127604afe4d1cec8cdca0450a83a3",
"author": 1,
"bytes": 17204,
"modified": 1429533845437,
"author_name": "anonymous",
"public_hash": "",
"version": 1429533845437,
"extradata": {},
"client_data": {},
"owner": 1,
"path": "/fs-vbfg/23-12.txt",
"folder": false,
"mime_type": "text/plain",
"icon": "document_text"
},
{
"owner_name": "anonymous",
"created": 1429533846152,
"deleted": false,
"checksum": "cc0127604afe4d1cec8cdca0450a83a3",
"author": 1,
"bytes": 17204,
"modified": 1429533846152,
"author_name": "anonymous",
"public_hash": "",
"version": 1429533846152,
"extradata": {},
"client_data": {},
"owner": 1,
"path": "/321/123.txt",
"folder": false,
"mime_type": "text/plain",
"icon": "document_text"
}
],
"is_last_page": false
}
dir_size_calculate/
Creates a task that updates directory size.
URL: https://api.server.com/api/1/dir_size_calculate/
Versions:1
Method: GET
Params:
- force:(Optional, Boolean) If True, calculate and update new size. If False, show the status of the task
Returns:
- 200
1.Calculate start message
Example
{
"status": "start calculating",
"time": 1530247417226
}
2.Status of current calculation with done message.
Example
{
"status": "done",
"time": "1530247417226"
}
- **404**
1.Status of the current calculation
Example
{
"status": "calculating",
"time": "1530247417226"
}
2.Does not have any result info in Task DB
Example
{
"status": null,
"description": "no previous result found"
}
get//
Get shared file
URL
https://api.server.com/api/1/get/
Versions: 1
Method: GET
Params:
path - The path to the file
for_view - Boolean whether for view or for download
invite_hash - Hash of the invitation
Returns:
- Download URL for the selected file
shares/invites/
Get shared files' metadata
URL https://api.server.com/api/1/shares/invites/
Versions: 1
Method: GET
Params:
- invite_hash - The unique hash of the user’s invitation to the shared folder
- path - Path of the folder
- listing - True to return metadata to all the items inside the folder
- dirs_only - If true only metadata of folders will be returned
- extra - Add extra data to the information about each version of the file
- offset - Shift from the beginning of the list.
- limit - Limit on the number of entries
Returns:
- metadata of the shared files
links/info/
Get public link information
URL https://api.server.com/api/1/shares/invites/
Versions: 1
Method: GET
Params:
hash - Hash of the links
author_lang - interface language (allowed values are “en", "kr", "jp")
Returns:
- Information about the public link
ACCOUNT MANAGEMENT
accounts/login/
Returns auth token.
URL: https://api.server.com/api/1/accounts/login/
Versions:1
Method: POST
Params:
login - mandatory. User login in a prepared format.
password - User password.
permanent_auth - Bool flag.
device_description - String. User device description.
Returns:
Auth token info dictionary.
Example
{
"token": "461ccb0663574a8d9836fbbdda64a46a",
"userid": 94,
"expires": 1334909019075,
"created": 1332230619075,
"offer_url": "http://some-offer.url"
}
accounts/logout/
Returns the token removal result.
URL: https://api.server.com/api/1/accounts/logout/
Versions:0,1
Method: POST
Params:
no parameters, authorization header is used to remove the token.
Returns:
200 Completed successfully
400 Cannot remove the token
accounts/approve/
Approves registration through a confirmation token, which is part of the registration confirmation URL sent to the user in an e-mail after registration.
URL: https://api.server.com/api/1/accounts/approve/
Versions:0,1
Method: GET
Params:
- hash:Mandatory. Token by which user registration can be confirmed.
Returns:
User data.
Errors:
404 User with the appropriate token was not found.
Example
{
"token": "461ccb0663574a8d9836fbbdda64a46a",
"userid": 94,
"expires": 1334909019075,
"created": 1332230619075
}
accounts/get/
Returns user account information.
URL: https://api.server.com/api/1/accounts/get/
Versions:1
Method: GET
Params:
- user_id - Not mandatory. User ID. If the authenticated user is omitted or is not an administrator, then the information for the authenticated user is returned. If the parameter is specified and the method is called by the administrator, information about the specified user is returned.
Returns:
User account information.
Example
{
"registration_date": 1362569459012,
"is_active": true,
"storage_size": 23241258,
"timezone": "Europe/Moscow",
"deleted_date": 0,
"name": "DIma1234567",
"lang": "ru",
"is_deleted": false,
"userid": 29,
"logins": ['email:root@root.com', 'msisdn:79201234567'],
"last_login": 1369226007680,
"role": "admin",
"balance": "n/a",
"overhead_size": 2297347,
"storage_usage": {"image": 1700, "audio": 1400, "video": 1400, "other": 300},
"need_password_change": False,
"extra_info": {}
}
accounts/check/
Checks if a user account exists.
URL: https://api.server.com/api/1/accounts/check/
Versions:1
Method: GET
Params:
- login - Mandatory. User login.
Returns:
User status “{‘status’: ‘ok’}” if the user account is found, otherwise
{‘status’: ‘not found’}
Errors:
404 The user with the corresponding login was not found.
accounts/remove_login/
Removes the specified login of the user.
URL: https://api.server.com/api/1/accounts/remove_login/
Versions:1
Method: POST
Headers:
Mountbit-Auth - authorization token
Params:
- login - login to remove
Returns:
200 Login was successfully removed
400 Cannot remove the last user login
404 Login not found
accounts/getinvited/
Returns the user's login by invitation token.
URL: https://api.server.com/api/1/accounts/getinvited/
Versions:1
Method: GET
Params:
- hash - Mandatory. An invitation token.
Returns:
Returns the login of the user to whom the invitation was sent.
Errors:
404 A user with the appropriate invitation token was not found.
accounts/recover_lost_password/
Sends the message necessary for temporary access to the account tied to the specified login to a passed login
URL: https://api.server.com/api/1/accounts/recover_lost_password/
Versions:1
Method: POST
Params:
- login - Mandatory. Login to which a message for authorization and further password change is sent.
Returns:
No data are returned
Errors:
400 The user with the entered login was not found in the system.
accounts/resend_message_for_approve/
Resends the message to approve the registration if the user has not already done so.
URL: https://api.server.com/api/1/accounts/resend_message_for_approve/
Versions:1
Method: POST
Params:
- login - a login that needs to be approved by resending the message
Returns:
No data are returned
Errors:
403 User has already confirmed registration.
accounts/change_profile/
Changes user profile parameters (name, password, etc.)
URL: https://api.server.com/api/1/accounts/change_profile/
Versions:0,1
Method: POST
Params:
name - Not mandatory. New username
password - Not mandatory. New user password. A link is sent to the user's email address, following the link user can return the account if the attacker changed the password.
lang - Not mandatory. Interface language (valid values: "en", "ru", "de")
timezone - Not mandatory. User’s time zone (can take the values "Europe / Moscow", "America / Los_Angeles", etc., for more details, see
List of tz database time zones
_)extra_info - Additional information for user
Returns:
no data are returned
Errors:
200 PasswordNotModified - Password was not changed
400 The user was not found in the system or one of the passed parameters
did not pass validation. Also, despite the fact that all parameters are
optional, at least one parameter must be set.
The list of tz database time zones: http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones
accounts/permanent_tokens/
The method returns a list of permanent tokens for the logged-in user.
URL: https://api.server.com/api/1/accounts/permanent_tokens/
Versions:0,1
Method: GET
Params:
No params
Returns:
A list of all permanent user tokens
Example
[
{
"device_description": "Васин Айфон",
"id": "51ee60f7a298e35b1688aacf",
"created": 1387798553613
},
{
"device_description": "Васин Айфон",
"id": "51ee613ea298e35b1688aad1",
"created": 1387798553614
}
]
accounts/remove_permanent_token/
Allows you to remove one of the existing permanent tokens.
URL: https://api.server.com/api/1/accounts/remove_permanent_token/
Versions:0,1
Method: POST
Params:
- token_id - Mandatory. Id of the token that needs to be removed.
Returns:
Code 200 - token was successfully removed
Code 404 - the transferred token was not found.
accounts/cancel_token_remote_wipe
Cancel the “remote_wipe” flag for auth_token.
URL: https://api.server.com/api/1/accounts/cancel_token_remote_wipe
Versions:1
Method: POST
Params:
- token_id - auth_token identifier
Errors:
404 AuthToken not found.
accounts/token_wiped
Remove auth_token with remote_wipe flag.
URL: https://api.server.com/api/1/accounts/token_wiped
Versions:1
Method: POST
Errors:
404 AuthToken with the remote_wipe flag not found.
accounts/accept_offer/
Confirm that the offer is accepted by the user.
URL: https://api.server.com/api/1/accounts/accept_offer/
Versions:0,1
Method: POST
Params:
No params
Returns:
Code 200 - Confirmation accepted.
accounts/get_offer/
Request an offer text
URL: https://api.server.com/api/1/accounts/get_offer/
Versions:0,1
Method: GET
Params:
No params
Returns:
HTML - offer page
Note:
An offer text is stored in a key-value with an offer key, if there is no such key or the value is not filled, an empty response will be returned.
accounts/decline_offer/
Decline the offer confirmation. It is used for testing purposes.
URL: https://api.server.com/api/0/accounts/decline_offer/
Versions:0,1
Method: POST
Params:
No params
Returns:
code 200 - Confirmation accepted.
Errors:
405 The method was denied by settings
Note:
This method is available only if the dynamic setting can_decline_offer == True
accounts/feedback/
Send feedback on the experience of using the application.
URL: https://api.server.com/api/1/accounts/feedback/
Versions:0,1
Method: POST
Params:
email- Not mandatory. Email of the user who sends feedback
comment - Mandatory. Message text.
Returns:
200 - feedback processed. The response contains JSON with the optional
parameter "url_upload_logs" - the URL at which the application logs
are uploaded (if required). The upload to URL is done using the POST
method, the file itself is passed in the parameter with the "log" key.
Example
curl -F "log=@/home/strannik/Temp/MountBit-v10.pdf" --header "User-Agent:
desktop-client-win" --progress-bar --verbose
http://app-logs-dev.mountbit.com/logs-upload/1/1384205541.38_52814ce5eae19d424aa898aa
Example
{
"url_upload_logs": "http://app-logs-dev.mountbit.com/logs-upload/1/5281420eeae19d3f166c820b"
}
accounts/feedback_list/
Get a list of feedbacks on the experience of using the applications (the method is available to the administrator only).
URL: https://api.server.com/api/1/accounts/feedback_list/
Versions:0,1
Method: GET
Params:
limit - Not mandatory. The number of values in the output
offset - Not mandatory. Indentation of values in the output
Returns:
List of feedbacks
Example
{
"count": 5,
"data": [
{
"text": "hgfhdsfhhsdfg",
"userid": 10,
"email": "erhgwher@ya.ru",
"created": 1384184924902
},
{
"text": "hgfhdsfhhsdfg",
"userid": 10,
"email": "erhgwher@ya.ru",
"created": 1384185209530
},
{
"text": "hgfhdsfhhsdfg12",
"userid": 10,
"email": "erhgwher@ya.ru",
"created": 1384185300032
},
{
"text": "sdbjsbdfjsdbf",
"userid": 1,
"email": "dmitry2@dmitry.com",
"created": 1384202303520
},
{
"text": "sdbjsbdfjsdbf",
"userid": 1,
"email": "dmitry2@dmitry.com",
"created": 1384202766141
}
]
}
accounts/set_value/
Save an arbitrary value defined by user for a given key.
URL: https://api.server.com/api/1/accounts/set_value/
Versions:1
Method: POST
Params:
key - Mandatory. The key by which the specified user value will be written or updated.
value - Mandatory. Key value.
Returns:
200 - if the value was successfully written or updated
accounts/get_value/
Get a value saved by user on the given key
URL: https://api.server.com/api/1/accounts/get_value/
Versions:1
Method: GET
Params:
- key - Mandatory. The key by which the search for the requested value will be performed.
Returns:
200 - returns a dictionary of the form {key: value} - if the key is
found, or {key: null} - if the key is not found.
company/<company id>
Returns company information data.
URL: https://api.server.com/api/1/company/<company_id>
Versions:1
Method: GET
Params:
- company_id - company identifier from URL string
Returns:
For company user:
company_id - company identifier
name - company name
owner_id - company's owner identifier
employees_count - company employees count
logo_url' - logo URL
domain' - subdomain name
storage_size - storage size
quota_size - quota size
registration_date - company registration date
For company administrator API shows all user's data and:
ldap_address - LDAP address
ldap_port - LDAP port
ldap_basedn - The LDAP Base DN for performing LDAP searches.
ldap_user_attribute - The attribute in the LDAP server that stores a user's login name.
public_links_allow - public links permissions (allowed or not)
Errors:
403 User has no rights to view company's data.
404 Company with the given ID not found.
company/domain/<domain>
Returns public information about the company by its domain name.
URL:https://api.server.com/api/1/company/domain/<domain>
Versions:1
Method: POST
Params:
- domain -company domain
Returns:
JSON dictionary with company information.
Errors:
404 Company with this domain not found
Example
{
"status": "active",
"domain": "domain_value",
"name": "company_name",
"company_id": 1,
"logo": "http://domain.com/image.jpg",
"auth_method": {
"email": true
}
}
company/<company_id>/logo_confirm/
Confirm logo upload as complete.
URL: https://api.server.com/api/1/company/<company_id>/logo_confirm/
Versions:1
Method: POST, GET
Params:
company_id - mandatory, company identifier from URL string
temp_name - temporary filename
size - company logo filesize, use it for file upload check
checksum - logo md5 checksum, use it for file upload check
Returns:
- no response data
Errors:
404 Company with the given ID not found.
company/<company_id>/logo_clear/
Clear company logo.
URL: https://api.server.com/api/1/company/<company_id>/logo_clear/
Versions:1
Method: POST, GET
Params:
- company_id - mandatory, company identifier from URL string
Returns:
No response data
Errors:
404 Company with the given ID not found.
company/<company_id>/logo_upload/
Creates a company logo picture.
URL: https://api.server.com/api/1/company/<company_id>/logo_upload/
Versions:1
Method: POST, GET
Params:
size - image file size
checksum - md5 control checksum
path - path to logo file image
Returns:
url - URL to upload image file
confirm_url - URL to confirm upload
Errors:
403 User has no rights to change company's settings.
404 Company with the given ID not found.
company/<company_id>/admin_change/
Change a company admin.
URL: https://api.server.com/api/1/company/<company_id>/admin_change/
Versions:1
Method: POST
Params:
company_id - mandatory, company identifier from URL string
user_id - mandatory, user id to change company admin
Returns:
Public company info
Errors:
403 User has no rights to change company's settings.
404 Company with the given ID not found or target user not found.
company/<company id>/users_enable/
Enable user in the company.
URL: https://api.server.com/api/1/company/<company_id>/users_enable/
Versions:1
Method: POST
Params:
company_id - mandatory, company identifier from URL string
user_id - mandatory, user ID
reason - Reason for enabling
Returns:
User public information, like a /accounts/get
Errors:
404 Company/User with the given ID not found.
company/<company id>/users_disable/
Disable user in the company.
URL: https://api.server.com/api/1/company/<company_id>/users_disable/
Versions:1
Method: POST
Params:
company_id - mandatory, company identifier from URL string
user_id - mandatory, user IDs list
reason - Reason for disabling
remote_wipe - Wipe data on all devices
Returns:
User public information, like a /accounts/get
Errors:
404 Company/User with the given ID not found.
company/<company id>/create_user/
Create a company user.
URL: https://api.server.com/api/1/company/<company_id>/create_user/
Versions:1
Method: POST, GET
Params:
company_id - mandatory, company identifier from URL string
login - mandatory, user login
name - mandatory, user name
password - mandatory, user password
Returns:
User public information, like a /accounts/get
Errors:
402 User quota exceeded.
403 User has no rights to change company's settings.
404 Company with the given ID not found.
accounts/company/<company id>/remove_user/
Remove user from a company.
URL: https://api.server.com/api/1/accounts/company/<company_id>/remove_user/
Versions:1
Method: POST, GET
Params:
company_id - mandatory, company identifier from URL string
user_id - mandatory, user id to remove
need_wipe - optional - set this flag if you need to wipe user data on devices
transfer_file - optional - set this flag if you need to transfer user's files
transfer_login - optional - user login to whom the files will be transferred
auto_remove - optional - set this flag if you need the user to be automatically removed.
Returns:
Users public information.
Errors:
403 User has no rights to change company's settings.
404 User with the given ID not found.
accounts/company/<company id>/confirm_user_removing/
Confirm removing of the user
URL: https://api.server.com/api/1/accounts/company/<company_id>/confirm_user_removing/
Versions:1
Method: POST, GET
Params:
company_id - mandatory, company identifier from URL string
user_id- mandatory, user for deletion identifier
Returns:
Users public information.
Errors:
403 User has no rights to change company's settings.
404 User not found with given ID.
412 User with this status can't be deleted
accounts/company/<company id>/cancel_user_removing/
Cancel user removing.
URL: https://api.server.com/api/1/accounts/company/<company_id>/cancel_user_removing/
Versions:1
Method: POST, GET
Params:
company_id - mandatory, company identifier from URL string
user_id - mandatory, user for deletion identifier
Returns:
Users public information.
Errors:
403 User has no rights to change company's settings.
404 User the given ID not found.
412 User with this status can't be deleted.
company/<company id>/users
Returns company employees list.
URL: https://api.server.com/api/1/company/<company_id>/users
Versions:1
Method: GET, POST
Params:
- company_id - company identifier from URL string
Returns:
Company's employees list, each record is as follows:
userid- employee identifier
name - employee name
position - employee position
Errors:
403 User has no rights to view company's data.
404 Company with the given ID not found.
Example
{
'content': ['userid':1, 'name': 'user name', 'position': 'manager'], [...], ...
}
company/user_permanent_tokens
Returns a permanent token list for a user. Used by companies admin.
URL: https://api.server.com/api/1/company/user_permanent_tokens
Versions:1
Method: GET, POST
Params:
- userid- user identifier from company
Returns:
Permanent tokens list, each record is as follows:
device_description - description string
id - token identifier
created - timestamp; the date of creation
Errors:
403 User has no rights to view company's data.
404 User not found.
Example
{"content":[
{
"device_description": "Васин Айфон",
"id": "51ee60f7a298e35b1688aacf",
"created": 1387798553613
},
{
"device_description": "Васин Айфон",
"id": "51ee613ea298e35b1688aad1",
"created": 1387798553614
}]
}
company/user_permanent_token/remove
Remove a permanent token for company user or mark a token for a remote wipe. Used by companies admin.
URL: https://api.server.com/api/1/company/user_permanent_token/remove
Versions:1
Method: POST
Params:
token_id - token identifier
remote_wipe - remote wipe flag
Returns:
No response data
Errors:
403 User has no rights to view company's data.
404 User or token not found.
company/user_permanent_token/cancel_remove
Cancel removing a permanent token.
URL: https://api.server.com/api/1/company/user_permanent_token/cancel_remove
Versions:1
Method: POST
Params:
- token_id - token identifier
Returns:
No response data
Errors:
403 User has no rights to view company's data.
404 User or token not found.
accounts/company/change_users_quota
Change quota_size and hard_quota_size for users.
URL: https://api.server.com/api/1/accounts/company/change_users_quota
Versions:1
Method: POST
Params:
company_id - mandatory, company identifier from URL string
users_id - mandatory, user IDs list
quota_size- mandatory, quota size for users
Returns:
Users public information, with error info and info about success and
failure.
Errors:
403 User has no rights to view company's data.
404 User or company not found.
Example
{
'success': 2,
'failed': 1,
'nodes': [
{
'userid': 12,
'error_code': None,
...
},
{
'userid': 12,
'error_code': None,
...
}
{
'error_code': 402,
'error_info': 'Company quota need increase.'
}
]
}
accounts/company/change_user_can_print
Change the user's option “can_print”.
URL: https://api.server.com/api/1/accounts/company/change_user_can_print
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
value - mandatory, option value.
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to change company's data.
404 User not found.
accounts/company/change_user_can_download
Change the user's option “can_download”.
URL: https://api.server.com/api/1/accounts/company/change_user_can_download
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
value - mandatory, option value
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to view company's data.
404 User not found.
accounts/company/change_user_can_upload
Change the user's option “can_upload”.
URL: https://api.server.com/api/1/accounts/company/change_user_can_upload
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
value - mandatory, option value
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to view company's data.
404 User not found.
accounts/company/change_user_pc_can_download
Change the user's option “pc_can_download”.
URL: https://api.server.com/api/1/accounts/company/change_user_pc_can_download
Versions:1
Method: POST
Params:
user_id - Mandatory, user ID.
value - mandatory, option value.
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to view company's data.
404 User not found.
accounts/company/change_user_can_print
Change the user's option “can_print”.
URL: https://api.server.com/api/1/accounts/company/change_user_can_print
Versions:1
Method: POST
Params:
user_id - mandatory, user ID.
value- mandatory, option value.
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to change company's data.
404 User not found.
accounts/company/change_mobile_restriction
Change the user's option “user_mobile_restriction”.
URL: https://api.server.com/api/1/accounts/company/change_mobile_restriction
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
value - mandatory, option value
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to change company's data.
404 User not found
accounts/company/change_user_ip_restriction
Change the user's option “use_watermarks”.
URL: https://api.server.com/api/1/accounts/company/change_user_ip_restriction
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
ip_restriction - mandatory, boolean, option value
allowed_ips - a comma-separated list of IP addresses
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to change company's data.
404 User not found.
accounts/change_admin_rights
Give a user admin rights.
URL: https://api.server.com/api/1/accounts/change_admin_rights
Versions:1
Method: POST
Params:
user_id - mandatory, user ID
set_admin - mandatory, boolean. If true, user set to sub admin.
Returns:
User public information, like a /accounts/get
Errors:
403 User has no rights to change company's data.
404 User/Company not found.
accounts/company/company_id/custom_user_agreement
Change custom user agreement
URL: https://api.server.com/api/1/accounts/company/company_id/custom_user_agreement
Versions:1
Method: POST
Params:
value - mandatory, value to enable or disable
show - optional, set when show agreement - first, each
agreement - optional, custom agreement text
Returns:
Company public information
Errors:
403 User has no rights to change company's data.
404 Company not found.
accounts/company/change_user_expired
Change an expire date set as a period
URL: https://api.server.com/api/1/accounts/company/change_user_expired
Versions:1
Method: POST
Params:
user_id. Mandatory. User ID.
expired. Mandatory. New expire date.
Returns:
User public information, like a /accounts/get
Errors:
400 Request doesn't have expired value
403 User has no rights to change company's data
404 User or company not found
accounts/company/company_id/update_reference/
Update reference email on company.
URL: https://api.server.com/api/1/accounts/company/company_id/update_reference/
Versions:1
Method: POST
Params:
company_id. Mandatory. Company ID.
reference_email. Mandatory. New reference email.
Returns:
200 OK
Errors:
400 Email form is invalid
403 User has no rights to change company's data
404 Company not found
accounts/create/
Registers a new user.
URL: https://api.server.com/api/0/accounts/create/
Versions:0
Method: POST
Params:
email - Not mandatory. An email address.
password - Not mandatory. Maximum size in bytes 256.
name - Not mandatory. Name. Maximum size in bytes 256.
company_name - Not mandatory. Company name.
company_plan - Not mandatory. Company rate plan.
invite_hash - Not mandatory. Invite token. When an existing user shares a folder with a new user who is not registered in the system yet, a new user is created automatically and invite_hash is generated for him. An email with this hash is sent to a new user. When a user follows the appropriate link, registration is performed. In this case, the user does not need to confirm his mail.
Returns:
User data
Errors:
404 User with such an email is already registered.
Example
{
"name": "Иван Иванов",
"email": "ivan@asdco.ru",
"storage_size": 11235122,
"balance": 123.45,
"is_active": true
}
info/
Return payment methods information
URL https://api.server.com/api/1/info/
Versions: 1
Method: GET/POST
Params:
None
Returns:
- Payment method information
choose/
Chooses the payment method
URL https://api.server.com/api/1/choose/
Versions: 1
Method: POST
Params:
- system- selected payment method
Returns:
- Confirmation of successful procedure
WORKFLOW
workflow/comment/<path>
Create a new file comment by path
URL: https://api.server.com/api/1/workflow/comment/<path>
Versions:1
Method: POST
Params:
- text. Mandatory. Text of a comment.
Returns:
A comment object
Example
.. code-block:: json
{
'id': '5ab970c1e1382347c353e85a',
'created_time': 1522100559404,
'text': 'Owner comment',
'taggedText': '',
'type': 'text',
'owner_id': 1
}
workflow/comment/edit
Edit a file comment by path
URL: https://api.server.com/api/1/workflow/comment/edit
Versions:1
Method: POST
Params:
comment_id. Mandatory. Comment identifier.
text. Mandatory. Text of a comment.
Returns:
A comment object
Example
.. code-block:: json
{
'id': '5ab970c1e1382347c353e85a',
'created_time': 1522100559404,
'text': 'Owner comment',
'taggedText': '',
'type': 'text',
'owner_id': 1
}
workflow/comment/delete
Delete a comment for a file by path
URL: https://api.server.com/api/1/workflow/comment/delete
Versions:1
Method: POST
Params:
- comment_id. Mandatory. Comment identifier.
Returns:
Empty.
workflow/comments/<path>
Returns a list of comments by path.
URL: https://api.server.com/api/1/workflow/comments/<path>
Versions:1
Method: GET
Params:
type. Not mandatory. Filter by comment type.
assignment. Not mandatory. Filter by task assignment.
status. Not mandatory. Filter by status.
Returns:
A list of comments by path.
Example
.. code-block:: json
[{
'id': '5ab970c1e1382347c353e85a',
'created_time': 1522100559404,
'text': 'Owner comment',
'taggedText': '',
'type': 'text', 'owner_id': 1
},]
workflow/comment/update_task_status
Update a comment task status
URL: https://api.server.com/api/1/workflow/comment/update_task_status
Versions:1
Method: POST
Params:
assignment_id - Mandatory. Assignment identifier.
status - Mandatory. New status.
Returns:
A comment object.
Example
.. code-block:: json
{
'id': '5ab970c1e1382347c353e85a',
'created_time': 1522100559404,
'text': 'Owner comment',
'taggedText': '',
'type': 'task',
'owner_id': 1,
'due_date': 0,
'assignees': [
{
'id': '5ab970c1e1382347c353e85a',
'user_id': 2,
'status': 'decline',
'created_time': 1522100559404
}
]
}