SMEStorage Multi-Cloud API Manual
The SMEStorage multi-cloud API provides a gateway into many different storage clouds. Clouds supported
are:
Amazon S3
RackSpace Cloud Files
Box.net
MobileMe
Microsoft SkyDrive
Microsoft Live Mesh
WebDav enabled Clouds
Gmail
Email (IMAP / POP 3 enabled)
FTP
The multi-cloud API provides ubiquitous access to these clouds overlaying file system functionality as well as
advanced features and services.
The SMEStorage API uses the REST architecture model. Once an account is registered with SMEStorage
(and this can be done programmatically) then cloud providers can be added and services can be used on
those cloud providers.
Manual Version 0.7.2
New in version 0.7.2:
Added description of function doModifyFile
Added description of function getSpaceInfo
Added description of function checkPathExists
Added description of function getFileFullInfo
Added description of function doAddContacts
Added description of function getProviderInformation
Added description of function doMoveFilesInBackground
Added description of function doChangeProviderSettings
New in version 0.7.1:
Added examples of functions
New in version 0.6.9:
Updated description of getFilesList and doInitUpload function.
Added description of new way of API Authentication.
New in version 0.6.8:
Described uploading resume
Added description of function getUploadStatusOnFail
Multi-Cloud API Manual
Extended description of file uploading procedure.
Extended description of doInitUpload function.
New in version 0.6.7:
Added function doSearchPublicFiles;
Added description of updateUsersData, setNewUserEmail, setNewUserPassword
Added description of Import contacts functions
getImportContactsProviders
getContactsForImport
doImportContacts
parseContactFile
getContactInfo
changeContactFile
getContactsList
doSuggestContacts
getStandartContactsFields
New in version 0.6.6:
Extended Email backup functions descriptions
Changed description of email account manage functions
Added description of Email Restore functions
Added function getUserInfo
Changed description of gettoken function
Added description of using external editors
New in version 0.6.5:
Added functions getMyFavouriteFiles and doFavouriteFile.
Described how favourite files works.
New in version 0.6.4_2:
Updated function doAddBucket.
New in version 0.6.4:
Add email backup function.
Described functions of scheduler.
Described functions of background tasks executor.
Described organization package functions.
Described messaging functions.
Changed description of doCreateNewFolder function
Described clipboard functions
Changed description of doDeleteFile function
New in version 0.6.3:
Added description of background functions
Multi-Cloud API Manual
Added description of twitter and tinyurl functions
New in version 0.6.2:
Added description of import/export functions
Added functions:doEditGroupUser, doDeleteInvitation,doRepeatInvitation,getAutoshareRules,
doAddAutoShareRule, doDeleteAutoShareRule
Modified functions: doCreateGroup, doRenameGroup
New in version 0.6.1:
Added function doSearchFiles;
Describe functions for creating the file: getAvaliableFileTemplates and createNewEmptyFile.
New in version 0.6:
Manual reorganised;
Described Trash functions;
Described provider functions;
New in version 0.5.7:
Described files structures
Modified description of doCreateNewFolder, doInitUpload, setFilesFilter functions.
New in version 0.5.6:
Described files filtering
Modified description of getFilesList function.
Added description of doSetFilesFilter, doDeleteFilesFilter, getFilesFilter.
New in version 0.5.5:
Added description of doCheckEncryptionPhrase
Described files encrypting procedure
Modified description of getFile and doInitUpload functions.
New in version 0.5.4:
Added description of setProviderData.
Added description of external logging in procedure.
Added description of doMoveFolders.
New in version 0.5.3:
Added description of getRegistrationForm, doRegistration, doActivation, doResendActivation .
Added description of registration procedure.
New in version 0.5.2:
Added description of doRequestFile .
New in version 0.5.1:
Added description of getAmountOfEmails, doBackupEmail, doZipBackupedEmailBox
Described email backup procedure.
New in version 0.5:
Added description of functions doInitUpload, doCompleteUpload and getUploadStatus;
Described new uploading procedure;
Multi-Cloud API Manual
New in version 0.4.2:
Added description of function getPermissions;
Edited description of function getFaxesList;
New in version 0.4.1:
Added description of function getFaxesList;
Added description of function doAddToMyFaxes;
New in version 0.4:
Added description of function doFaxDocuments;
New in version 0.3:
Added description of function doPublicFile;
New in version 0.2:
Added description of function doShareFolderWithGroup;
Changed description of function getAllShared;
Multi-Cloud API Manual
Table of content
SMEStorage Multi-Cloud API Manual .................................................................................................................1
Requests .........................................................................................................................................................9
Responses ......................................................................................................................................................9
Alternative ways to make response ...........................................................................................................10
How it works .................................................................................................................................................. 11
Quick way to call API function ....................................................................................................................... 11
API Functions ...................................................................................................................................................12
Login functions ..............................................................................................................................................12
gettoken .....................................................................................................................................................12
getPermissions ..........................................................................................................................................13
getRegistrationForm ..................................................................................................................................14
doRegistration ...........................................................................................................................................15
doActivation ...............................................................................................................................................16
doResendActivation...................................................................................................................................17
setProviderData .........................................................................................................................................18
..................................................................................................................................................................18
getUserInfo ................................................................................................................................................19
updateUsersData .......................................................................................................................................20
setNewUserPassword ...............................................................................................................................21
setNewUserEmail ......................................................................................................................................22
Cloud File functions .......................................................................................................................................23
getFilesList ................................................................................................................................................23
doMoveFiles ..............................................................................................................................................24
doMoveFilesInBackground ........................................................................................................................25
doRenameFile ...........................................................................................................................................26
doModifyFile ..............................................................................................................................................27
doDeleteFile ..............................................................................................................................................28
doUploadFiles ............................................................................................................................................29
getFile ........................................................................................................................................................31
getFileFullInfo ............................................................................................................................................32
checkPathExists ........................................................................................................................................33
doCheckEncryptionPhrase ........................................................................................................................34
doInitUpload ..............................................................................................................................................35
doCompleteUpload ....................................................................................................................................37
getUploadStatus ........................................................................................................................................38
getUploadStatusOnFail .............................................................................................................................39
doSearchFiles ............................................................................................................................................40
doSearchPublicFiles ..................................................................................................................................41
getAvaliableFileTemplates .........................................................................................................................43
createNewEmptyFile .................................................................................................................................44
doFavouriteFile ..........................................................................................................................................46
getMyFavouriteFiles ..................................................................................................................................47
Folder functions .............................................................................................................................................48
doCreateNewFolder ..................................................................................................................................48
doRenameFolder .......................................................................................................................................49
doDeleteFolder ..........................................................................................................................................50
doMoveFolders ..........................................................................................................................................51
Cloud Group and sharing functions ..............................................................................................................52
doSendEmail .............................................................................................................................................52
getGroupsList ............................................................................................................................................53
getAllShared ..............................................................................................................................................54
doCreateGroup .........................................................................................................................................55
doRenameGroup .......................................................................................................................................56
doDeleteGroup ..........................................................................................................................................57
doEditGroupUser .......................................................................................................................................58
doInviteToGroup ........................................................................................................................................59
doRepeatInvitation.....................................................................................................................................60
doAcceptInvitation .....................................................................................................................................61
Multi-Cloud API Manual
doDeleteInvitation .....................................................................................................................................62
doShareFileWithGroup ..............................................................................................................................63
doShareFolderWithGroup .........................................................................................................................64
doDeleteShared.........................................................................................................................................66
doUnsubscribeGroup ................................................................................................................................67
doRequestFile ...........................................................................................................................................68
doPublicFile ...............................................................................................................................................69
getAutoshareRules ....................................................................................................................................70
doAddAutoShareRule ................................................................................................................................71
doDeleteAutoShareRule ............................................................................................................................72
Email backup functions .................................................................................................................................73
getEmailAccounts ......................................................................................................................................73
doCheckEmailAccountSettings .................................................................................................................74
doCreateEmailAccount ..............................................................................................................................75
doEditEmailAccount ..................................................................................................................................77
doDeleteEmailAccount ..............................................................................................................................79
doBackupEmailBox ...................................................................................................................................80
doBackupEmailBoxInBackground .............................................................................................................81
getAmountOfEmails...................................................................................................................................82
getEmailAccountFolders ...........................................................................................................................83
doBackupEmail..........................................................................................................................................84
doZipBackupedEmailBox ..........................................................................................................................85
Fax functions .................................................................................................................................................86
doFaxDocuments ......................................................................................................................................86
getFaxesList ..............................................................................................................................................87
doAddToMyFaxes ......................................................................................................................................88
Filter functions ...............................................................................................................................................89
getFilesFilter ..............................................................................................................................................89
doSetFilesFilter ..........................................................................................................................................90
doDeleteFilesFilter.....................................................................................................................................91
Trash functions ..............................................................................................................................................92
getTrash.....................................................................................................................................................92
doDeleteFromTrash...................................................................................................................................93
..................................................................................................................................................................93
doRestoreFromTrash ................................................................................................................................94
Provider functions .........................................................................................................................................95
getProviders ..............................................................................................................................................95
doProviderSync .........................................................................................................................................96
doProviderSyncInBackground ...................................................................................................................97
doAddProvider .........................................................................................................................................100
doSetDefaultProvider ..............................................................................................................................102
doSetMasterCopy ....................................................................................................................................103
getProviderBuckets .................................................................................................................................104
doUpdateBucketsList...............................................................................................................................105
doSetDefaultBucket .................................................................................................................................106
doAddBucket ...........................................................................................................................................107
doChangeProviderPassword ...................................................................................................................108
doChangeProviderSettings .....................................................................................................................109
getProviderInformation ............................................................................................................................ 110
Import/Export functions ............................................................................................................................... 111
getImpExpProviders ................................................................................................................................ 111
doImpExpLogin........................................................................................................................................ 112
doExpChoseDest..................................................................................................................................... 113
doExpChoseSource................................................................................................................................. 114
doExport .................................................................................................................................................. 115
doExportInBackground ............................................................................................................................ 116
doImpChoseSource ................................................................................................................................. 117
doImpChoseDest ..................................................................................................................................... 118
doImport .................................................................................................................................................. 119
doImportInBackground ............................................................................................................................120
Multi-Cloud API Manual
Contacts import functions ............................................................................................................................121
getImportContactsProviders ....................................................................................................................121
getContactsForImport ..............................................................................................................................123
doImportContacts ....................................................................................................................................124
doAddContacts ........................................................................................................................................126
parseContactFile .....................................................................................................................................127
getContactInfo .........................................................................................................................................128
changeContactFile...................................................................................................................................129
getContactsList ........................................................................................................................................130
doSuggestContacts .................................................................................................................................131
getStandartContactsFields ......................................................................................................................132
Organization package functions ..................................................................................................................133
getOrganizationStaff ................................................................................................................................133
doCreateOrgMember...............................................................................................................................134
getOrganizationLogs ...............................................................................................................................135
getMyInfo .................................................................................................................................................136
Messaging ...................................................................................................................................................137
doSendInternalMessage .........................................................................................................................137
getInternalMessagesForUser ..................................................................................................................138
getSentInternalMessages ........................................................................................................................139
doMarkInternalMessageAsRead .............................................................................................................140
doSetMessageRead ................................................................................................................................141
Clipboard functions .....................................................................................................................................142
getClipboardFiles.....................................................................................................................................142
addFilesToClipboard ................................................................................................................................143
removeFilesFromClipboard .....................................................................................................................144
doClearClipboard.....................................................................................................................................145
addFolderToClipboard .............................................................................................................................146
Other functions ............................................................................................................................................147
getSpaceInfo ............................................................................................................................................147
doSendFileLinkToTwitter .........................................................................................................................148
getFileTinyURL ........................................................................................................................................149
getSchedulerTypesForUser .....................................................................................................................150
getUserSchedulerTasks ..........................................................................................................................151
addUserSchedulerTask ...........................................................................................................................152
deleteUserSchedulerTask .......................................................................................................................153
getUserBackgroundTasks .......................................................................................................................154
deleteBackgroundTask ............................................................................................................................155
deleteAllBackgroundTasks ......................................................................................................................156
cancelBackgroundTask ...........................................................................................................................157
cancelAllBackgroundTasks ......................................................................................................................158
restartBackgroundTask ............................................................................................................................159
Registration of new user .............................................................................................................................160
External logging on .....................................................................................................................................160
Working with providers ................................................................................................................................160
Adding a cloud provider ...........................................................................................................................160
Resynchronising of cloud provider ..........................................................................................................161
Managing buckets ...................................................................................................................................161
Other cloud provider options ...................................................................................................................161
Faxing..........................................................................................................................................................161
Uploading ....................................................................................................................................................162
Uploading procedure steps in details. .....................................................................................................162
Backup of emails .........................................................................................................................................163
Encrypting of files ........................................................................................................................................163
Filtering the content.....................................................................................................................................163
Structures ....................................................................................................................................................165
Import/Export ...............................................................................................................................................165
Import ......................................................................................................................................................165
Export ......................................................................................................................................................166
Organisation packages ...............................................................................................................................167
Multi-Cloud API Manual
Scheduler tasks and background tasks ......................................................................................................167
Favourite files ..............................................................................................................................................167
Using external editors for files .....................................................................................................................167
Uploading resume .......................................................................................................................................168
Code Examples ..............................................................................................................................................169
Example of Upload Resume with Perl. .......................................................................................................169
Multi-Cloud API Manual
Requests
The API requests are HTTP request of a specially formatted URL. The URL looks like
http://smestorage.com/api/token/function/arguments
token - special authentication string that can be get with special login request
function - string that identifies the request function
arguments - comma separated list of arguments that are encoded with base64 method
Important! Arguments order must be the same as in function description.
Request examples:
http://smestorage.com/api/*/gettoken/R2VsZW1ianVr,MjUxMjE5ODI=
Get token by login and password. There are login and password R2VsZW1ianVr,MjUxMjE5ODI= that are
base64 encoded.
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFilesList/
Get list of files and folders.
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSendEmail/MTQ4,dG93ZXIuZ3J2QGdt
YWlsLmNvbQ==,cm9tYW4=,aGVsbG8=,
Send email to friend with link to file.
Responses
The response of the API is XML an document (except if successfully downloading a file).
Structure of the response:
ok
Status message
...additional data...
Example:
ok
Success
getFilesList
17
78
0
26
111newname
222descr
1
2008-01-28 01:54:59
0
...
4825455
262144000
128
test2
26
...
Alternative ways to make response
REST request can be made in an alternative way by calling the script
http://smestorage.com/api/rpc.php
and passing arguments with the GET or POST method.
Main arguments names:
token,function,args
Also arguments can be individually without base64 encoding.
For example: to send email to a friend call the API script with arguments:
token=1a3c5b2c5e64d5ecb56df380871594dc
function=doSendEmail
fi_id=123
friend_email=roman@gelembjuk.com
from_name=SMEAdmin
text=sea here
days=2
Detailed about each argument see below.
Each function description ends with a list of names for arguments. To call function the primary way
(see above) the names are not needed. Use argument names only when you use alternative method
to call function.
How it works
1. Client requests a token by passing login and password.
2. Servers check login info and return token or error
3. Client uses token in each API operation
4. Token expires in 60 minutes from last activity. The client then needs to request a token again.
Quick way to call API function
If it is needed to call only 1 function per session then there is another way to authenticate the user.
To use this the API this way, add user login and password to rthe equest of the API. In this case the token
must be set '*', login and password must be 1-st and 2-nd arguments of the call. If function has arguments
then 1-st argument is moved to 3-rd position and so on.
If the alternate request method is used then there should be arguments us_login and us_pwd in the call.
Example:
http://smestorage.com/api/rpc.php?token=*&function=getFilesList&us_login=testuser&us_pwd=testpassword
API Functions
Login functions
gettoken
Get token for operations.
In this function the token must have the value “*” .
Arguments:login,password
Example:
http://smestorage.com/api/*/gettoken/R2VsZW1ianVr,MjUxMj23ODI=
Success response parameters:
token - contains the token.
Also this function returns data about last user login.
Lastlogin – date of last login; autologincode – this is code that can be used to save files from external editor
for temporary user authentication. See details in description of Using external editors.
Argument names to call this function with alternative method (GET or POST)
us_login - login
us_pwd - password
Example.
Request example:
http://smestorage.com/api/rpc.php?token=*&function=gettoken&us_login=u_login&us_pwd=u_password
Alternate request:
http://smestorage.com/api/*/gettoken/dmlraW5nYWRtaXJhbA==,dmlraW5nYWRtaXJhbA==
Response:
ok
Success
c32d76a741be890d629cba1536cdb53a
2009-11-10 15:32:20
edf1335c0d1abb6432b13f45e1a589a6
getPermissions
Returns permissions for user. This can determine whether the user can access different features.
Arguments: no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ getPermissions/
Success response parameters:
The list of permissions.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=getPermissions&
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/getPermissions/
Response:
ok
Success
getPermissions
n
y
y
y
getPermissions
getRegistrationForm
Returns data used for the registration of new users.
Arguments:
No arguments
Example:
http://smestorage.com/api/*/getRegistrationForm/
Success response parameters:
The function returns the structure needed for registration. These are the list of fields needed for registration,
ordering of these fields, the list of packages for users and captcha information. The captcha information is a
captcha image (base64 encoded) and captcha session id. Captcha session id must be used in calling of the
function doRegistration to process registration.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=*&function=getRegistrationForm&
Alternate request:
http://smestorage.com/api/*/getRegistrationForm/
Response:
ok
Success
getRegistrationForm
Full Name
Login
Password
Email
ignore
ignore
ignore
Validation code
Package
hidden
ignore
1
FREE Package
The Free Package gives you free access to 250 MB storage on Amazon
S3.
262144000
0.00
1
2007-06-23 23:38:50
1
0
2,4,5,7,8,11,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27
M:1
n
1
……..
doRegistration
Process registration. Function getRegistrationForm must be called before this function to get captcha
session id.
Arguments:
10 arguments: user name, user login, user password, user email,user twitteruse, twitterlogin, twitterpwd,
captcha key, package id, captcha session id
Example:
http://smestorage.com/api/*/doRegistration/TRG,HGt,LKLKHLKHK,LKHLKH,LKJGKJ,KJGKFJK,KLGKHF
Success response parameters:
The function returns nothing, Just „success‟ or error description.
Argument names to call this function with alternative method (GET or POST)
us_name - user name
us_login - user login
us_pwd - user password
us_email - user email
us_twitteruse - if to use twitter
us_twitterlogin - twitter login
us_twitterpwd - twitter password
key - captcha code
us_slevel - user package
captcha_sessionid - captcha session
Example.
Request example:
http://smestorage.com/api/rpc.php?token=*&function=doRegistration&us_name=xx_user_name&us_login=x
x_user_login&us_pwd=xx_user_password&us_email=xx_user@gmail.com&us_twitteruse=twitter_user_nam
e&us_twitterlogin=twitter_login&us_twitterpwd=twitter_password&key=4mdf&us_slevel=2&captcha_sessioni
d=28ef4a27403175360d65537465b26836
Alternate request:
http://smestorage.com/api/*/doRegistration/eHhfdXNlcl9uYW1l,eHhfdXNlcl9sb2dpbg==,eHhfdXNlcl9wYXNzd
29yZA==,eHhfdXNlckBnbWFpbC5jb20=,dHdpdHRlcl91c2VyX25hbWU=,dHdpdHRlcl9sb2dpbg==,dHdpdHRl
cl9wYXNzd29yZA==,NG1kZg==,Mg==,MjhlZjRhMjc0MDMxNzUzNjBkNjU1Mzc0NjViMjY4MzY=
Response:
ok
Success
doRegistration
4628
doRegistration
doActivation
Process registration activation. Activation code is obtained from the activation email.
Arguments:
Activation code
Example:
http://smestorage.com/api/*/doActivation/TRGHGtLKL
Success response parameters:
The function returns a parameter, „completed‟ , that indicates if the registration if fully completed. If
„completed‟ it is equal to 0 then the user must pay for package. In this case there also a parameter url that
defines the url to redirect user for payment.
Argument names to call this function with alternative method (GET or POST)
activationcode - activation code
Example.
Request example:
http://smestorage.com/api/rpc.php?token=*&function=doActivation&activationcode=5cd049a0221e8269af8d
c70217ae5ea3
Alternate request:
http://smestorage.com/api/*/doActivation/NWNkMDQ5YTAyMjFlODI2OWFmOGRjNzAyMTdhZTVlYTM=
Response:
ok
Success
doActivation
0
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-
subscriptions&business=smestorage%40thesmespace.com&item_name=Basic+%28username%3A+xx_use
r_login%29&a3=0.50&p3=1&t3=M&src=1&sra=1&no_note=1&usr_manage=0&custom=4628¤cy_cod
e=USD&rm=1&return=http%3A%2F%2Fwww.smetube.com%2Fsmestorage%2Fpaypalthanks.php&cancel_r
eturn=http%3A%2F%2Fwww.smetube.com%2Fsmestorage%2Findex.php%3Fp%3Dmypackage%26frompa
ypal%3Dcancel_return¬ify_url=http%3A%2F%2Fwww.smetube.com%2Fsmestorage%2Fipn.php&
doActivation
doResendActivation
Process the resending of the activation email. Also you can change the email for the user if the email was set
wrong during registration. If 3-rd parameter is set (email) then email for user will be changed.
Arguments:
3 arguments: user login, user password, user email (optional)
Example:
http://smestorage.com/api/*/doResendActivation/TRGH,GtLKL,JGKJGKJGKJGKJG
Success response parameters:
The function returns nothing. Just success or error description.
Argument names to call this function with alternative method (GET or POST)
us_login - user login
us_pwd - user password
us_email - user email
Example.
Request example:
http://smestorage.com/api/rpc.php?token=*&function=doResendActivation&us_login=xx_user_login&us_pwd
=xx_user_password&us_email= xx_user@gmail.com
Alternate request:
http://smestorage.com/api/*/doResendActivation/eHhfdXNlcl9sb2dpbg==,eHhfdXNlcl9wYXNzd29yZA==,YW
RldmlrYXRAZ21haWwuY29t
Response:
ok
Success
doResendActivation
doResendActivation
setProviderData
Sets external cloud provider login info for the session if this info were not saved.
Arguments:
2 arguments: user login and user password (API keys for some providers) of external provider
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/setProviderData/TRGH,GtLKLHJjj
Success response parameters:
The function returns nothing. Just success or error description.
Argument names to call this function with alternative method (GET or POST)
pi_login - user login of external cloud provider
pi_password - user password
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=setProviderData&
pi_login=pi_xx_user_login&pi_password=pi_xx_user_password
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/setProviderData/cGlfeHhfdXNlcl9sb2dpbg=
=,cGlfeHhfdXNlcl9wYXNzd29yZA==
Response:
ok
Success
setProviderData
setProviderData
getUserInfo
Returns the current user information.
Arguments:
no argument
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getUserInfo/
Success response parameters:
The function returns information about the user.
One of the information items is us_isorg. This indicates the Organization status of the user. If this item is 0
then this is a single user. If this value is 1 then this user is Org member. If this value is 2 then this user is Org
admin.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=getUserInfo&
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/getUserInfo/
Response:
ok
Success
4626
u_name
u_login
user_viking@gmail.com
2009-11-10 12:21:18
0
0
2009-11-10 15:32:20
193.239.129.242
n
n
n
n
1
FREE Package
The Free Package gives you free access to 250 MB storage on Amazon S3.
262144000
0
getUserInfo
updateUsersData
This function is used to update user account data. Currently it is possible to update user name, phone and
address.
Arguments:
User name,
User address,
User phone
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=updateUsersDat
a&us_name=Vasia&us_address=Moskov&us_phone=5555555
Success response parameters:
Success or not.
Argument names to call this function with alternative method (GET or POST)
us_name - User name
us_address - User address
us_phone - User phone
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=updateUsersData
&us_name=viking&us_phone=0504567788
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/updateUsersData/dmlraW5n,MDUwNDU2N
zc4OA==
Response:
ok
Success
updateUsersData
setNewUserPassword
This function is used to update a user's account password. You have to provide the current (old) user's
password to set a new password.
Arguments:
Old (current) password,
New password
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=setNewUserEm
ail&us_pwd=myoldpassword&newpassword=mynewpassword
Success response parameters:
Success or not.
Argument names to call this function with alternative method (GET or POST)
us_pwd - old password
newpassword - new password
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=setNewUserPass
word&us_pwd=u_password&newpassword=u_password123
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/setNewUserPassword/dmlraW5nYWRtaXJh
bA==,dmlraW5nYWRtaXJhbA==
Response:
ok
Success
setNewUserPassword
setNewUserEmail
This function is used to update a user's account email. This function must be called 2 times. First to send the
email verification message, and the second call is confirming the email with a code. Also there is 3-rd mode
of this function to check if there was set a new email for verification.
How it works: Call this function with step=3 and data=new user email. Email message will be send to this
email with confirmation code in the body. Ask the user to copy that code and provide to application. Then call
this function again with step=2 and data=confirmation code. Email will then be changed.
Arguments:
Step - 1,2 or 3. 1 to set new email and send verification message, 2 to enter verification code, 3 to
return email if it was set for verification.
Data - if step is 1 then this argument is new user email. If step is 2 then this argument is
confirmation code. If step is 3 then this argument is not used.
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=setNewUserEm
ail&step=1&data=mynewemail@user.com
Success response parameters:
Status data
Argument names to call this function with alternative method (GET or POST)
step - step
data - data
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1a6b0bedd3fbedcf14c7f1066397f484&function=setNewUserEmail
&step=1&data=someemail@gmail.com
Alternate request:
http://smestorage.com/api/1a6b0bedd3fbedcf14c7f1066397f484/setNewUserEmail/MQ==,a29zdHlya29fc2V
yaGlqQG1haWwucnU=
Response:
ok
Success
setNewUserEmail
Cloud File functions
getFilesList
Return all files and folders with all attributes. Also returns all tags.
Arguments:
folder id. If argument is not passed then all files and folders are returned.
Limitlonglists (optional) . This argument must be set to 1 if it is required to not load files list when it is too long
(to many files) and filter is not set.
Ignore filter (optional) - if is 'y' then all files are loaded even if filter is set.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFilesList/
Success response parameters:
XML structure with data of the database tables Files and Tags. Also includes filter data and some statistics
(total amount of files/folders, amount of filtered files/folders).
Argument names to call this function with alternative method (GET or POST)
fi_id - folder id
limitlonglists - 1 if do not load files list if there are too many files
ignorefilter - 'y' or 'n'. If missed then is 'n'.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getFilesList&fi_i
d=&limitlonglists=0&ignorefilter=y
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getFilesList/,MA==,eQ==
Response:
ok
Success
getFilesList
1
5
5
1
getFilesFilter
0
0
0
0
0
……
0
0
doMoveFiles
Move files to another folder.
Arguments: fileid,folderid
FileID can be a comma separated list of ids. In this case all files will be moved to folder
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doMoveFiles/MTQ4,dG93ZX
Success response parameters:
Moved files info
Argument names to call this function with alternative method (GET or POST)
fi_ids - fileid
dir_id - folderid
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doMoveFiles&fi_
ids=1013219&dir_id=1012825
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doMoveFiles/MTAxMzIxOQ==,MTAxMjgy
NQ==
Response:
ok
Success
doMoveFiles
1013219
1
1012825
0
0
doMoveFilesInBackground
Add background task to move file.
Arguments: fileid,folderid
FileID can be a comma separated list of ids. In this case all files will be moved to folder
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doMoveFilesInBackground/MTQ4,dG93Z
X
Success response parameters:
Status if background task was added.
Argument names to call this function with alternative method (GET or POST)
fi_ids - fileid
dir_id - folderid
doRenameFile
Rename file or change attributes (description,tags)
Arguments: fileid,filename,filedescription,filetags
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRenameFile/MTQ4,dG93ZX,FtGdRT,Ht
GfGjjtkj657jJHGmHGM
Success response parameters:
Altered file info
Argument names to call this function with alternative method (GET or POST)
fi_id - fileid
fi_name - filename
fi_description - filedescription
fi_tags - filetags
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doRenameFile&f
i_id=1013219&fi_name=new_name&fi_description=description_for_file&fi_tags=
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doRenameFile/MTAxMzIxOQ==,bmV3X25
hbWU=,ZGVzY3JpcHRpb25fZm9yX2ZpbGU=,
Response:
ok
Success
doRenameFile
1013219
1012825
4626
new_name
upl_4af9a908a7e1a.1
1
description_for_file
0
2009-11-10 17:55:20
0
application/octet-stream
5b851bb38eabaf38a7ebac46b414b5e6
0
0
0
0
g
……….
0
0
doModifyFile
Change file attributes. Any attributes , exclude fi_id and fi_uid can be changed.
Arguments:
fileid – id of the file,
file data to update in format field1=value1field3=value2.... . Where
if “\n” symbol.
Values are base64 encoded ('y' or 'n'). Set 'y' if values are base64 encoded. This can be used if
value is text that can include “\n” symbol
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doModifyFile/MTQ4,dG93ZXFtGdRTHtGf
Gjjtkj657jJHGmHGM
Success response parameters:
Updated file info
Argument names to call this function with alternative method (GET or POST)
fi_id - fileid
data - file data
base64 - 'y' or 'n'
doDeleteFile
Delete file
Arguments:
File ID or comma separated list of file ids
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteFile/MTQ4
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
fi_id - file id
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doDeleteFile&fi_
id=1013219
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doDeleteFile/MTAxMzIxOQ==
Response:
ok
Success
1013219
doDeleteFile
1013219
0
262144000
doUploadFiles
Upload filea.
This is the only request that need arguments that are passed with the POST method.
Form action URL to upload the file is:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doUploadFiles/
Arguments:
fi_pid - parent folder id. If empty then is uploaded to root folder.
fi_structtype - structure type (see Structures). If not important, then set this parameter to „g‟
file_name1 - file name
file_desc1 - file description
file_tags1 - file tags (comma separated)
file_1 - name of attached file (name of input parameter of file type)
Also it is possible to upload more then 1 file (max. 5). IN this case use additional parameters with names
file_name2,file_desc2,... and so on.
Example.
Response:
ok
Success
ok
Success
doUploadFile
1033416
1012825
4626
xxxXxxx
upl_4b0411c6e6da5.1
……………..
630
262144000
doUploadFiles
630
262144000
xxtagsxx
1
1258579494
………….
getFile
Download files.
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFile/MTQ4
Arguments:fileid, encryption phrase
Encryption phrase is required only for encrypted files.
Response:
If file exists then the response is actually the file. If file doesn't exist then an xml document with an error
message is returned.
Argument names to call this function with alternative method (GET or POST)
fi_id - fileid
encryptphrase - encryption phrase
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getFile&fi_id=10
17088&encryptphrase=
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getFile/MTAxNzA4OA==,
Response:
11111111111111111111
getFileFullInfo
Returns full info for the file. Including geo info.
Arguments:
file ID
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFileFullInfo/TRGH
Success response parameters:
The function returns file info
Argument names to call this function with alternative method (GET or POST)
fi_id - file ID
checkPathExists
Check if file/folder path exists and returns file/folder id.
Arguments:
Path – path to file/folder in format forder1/folder2/subfolder3/filename.ext
Pid - id of the folder that is used as base of the path. If path is from the root then this argument is
0.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/checkPathExists/TRGHLJKhJTKkkjgfiUFK
R,IY=
Success response parameters:
The function returns file/folder ID if path exists. Also returns items that defines if path exists or not.
Argument names to call this function with alternative method (GET or POST)
path - file/folder path
pid - base folder id.
doCheckEncryptionPhrase
Checks if the encryption phrase is correct for the file.
Arguments:
2 arguments: file id and encryption phrase
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCheckEncryptionPhrase/TRGH,GtLKLH
Jjj
Success response parameters:
The function returns checkresult field in response. If checkresult is 1 then phrase is correct.
Argument names to call this function with alternative method (GET or POST)
fi_id - file ID
encryptphrase - encryption phrase
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doCheckEncrypt
ionPhrase&fi_id=1017088&encryptphrase=xx
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doCheckEncryptionPhrase/MTAxNzA4OA
==,eHg=
Response:
ok
Success
doCheckEncryptionPhrase
1
doInitUpload
Prepare info for uploading of new files. This function receives file data and checks it.
Arguments:
File name - name of the file;
Description - description of the file;
Tags - tags;
Pid - id of the parent folder
Filename - real file name (name of the local file. It is needed to check extension for
mimetype. It is possible to set extension only here . Ex. „.doc‟)
Responsetype - defines how uploading script will respond. Can be set to one of 4 values: json,
json64, javascript, xml
Responsedata - is used when responsetype is javascript. In this case this value is
javascript code that will be executed when uploading completed.
Encryption phrase - the phrase that is used to encrypt phrase. If missed then file is not
encrypted.
Reserved - this argument is reserved. Just leave it empty
Structure type - defines structure type (See structures).
FileID - the id of the file that should be overwritten. If is missed or is 0 then
this file will be saved as new file. If this argument is id of existent file, then
Chunk the file - this argument can be set to 'y' or 'n'. It works only for packages where
chunking allowed. If is not set then value from user settings is used. This argument
is used to overwrite existent setting value.
File local time - file local time. This is optional and can be used to sync with local file systems
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doInitUpload/BaSE64EncoDedDaTA
Success response parameters:
The function returns uploading code. This code is important and must be used in uploading form and in
doCompleteUpload function.
Also the function returns the node 'resumeallowed'. It defines if user can resume uploading (when uploading
fails or user paused).
Argument names to call this function with alternative method (GET or POST)
fi_name - name of the file;
fi_description - description of the file;
fi_tags - tags;
fi_pid - id of the parent folder;
fi_filename - real file name;
responsetype - Response type
responsedata - Response data
encryptphrase - Encryption phrase
fi_structtype - structure type code
fi_id - id of the file.
chunkifbig - 'y' or 'n'. Chunk or not.
fi_localtime - file local time in format 'YYYY-MM-DD hh:mm:ss'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doInitUpload&fi_
name=filename_1.txt&fi_description=the_test_file&fi_tags=&fi_pid=1012825&fi_filename=.txt&responsetype
=xml&responsedata=&encryptphrase=&fi_structtype=g&fi_id=&chunkifbig=n
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doInitUpload/ZmlsZW5hbWVfMS50eHQ=,
dGhlX3Rlc3RfZmlsZQ==,,MTAxMjgyNQ==,dDUudHh0,eG1s,,,Zw==,,bg==
Response:
ok
Success
doInitUpload
n
6eb0b5311a0d1fa7ec78289ec4184382
text/plain
doCompleteUpload
Complete files uploading procedure. This function does the final work on file uploading.
Arguments:
The only argument is uploading code that was received with doInitUpload function.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCompleteUpload/BaSE64EncoDedDaT
A
Success response parameters:
The function returns uploads file data.
Argument names to call this function with alternative method (GET or POST)
uploadcode - Uploading code that was returned with function doInitUpload
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doCompleteUplo
ad&uploadcode=27a90c8d2a489ee145813037e017bd9f
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doInitUpload/MjdhOTBjOGQyYTQ4OWVl
MTQ1ODEzMDM3ZTAxN2JkOWY=
Response:
ok
Success
doCompleteUpload
20
sdf_2009-11-18
1033420
1012824
4626
sdf_2009-11-18
upl_4b042a5dbbb0b.1
1
xcv
2009-11-18 17:10:30
20
application/octet-stream
Some_tags
1bd685c2efa203687274f5feb76ece43
g
….…………
getUploadStatus
Get uploading status while uploading is in progress.
Arguments:
The only argument is the uploading code that was received with doInitUpload function.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getUploadStatus/BaSE64EncoDedDaTA
Success response parameters:
The function returns uploading status: percent of data, amount of bytes that has been uploaded, total file size
and file name.
Argument names to call this function with alternative method (GET or POST)
uploadcode - Uploading code that was returned with function doInitUpload
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getUploadStatus
&uploadcode=6fb73f5efeb69286690b8c689598c374
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getUploadStatus/NmZiNzNmNWVmZWI2
OTI4NjY5MGI4YzY4OTU5OGMzNzQ=
Response:
ok
Success
getUploadStatus
6fb73f5efeb69286690b8c689598c374
/home/webadmin/smetube.com/cgi-bin/uploader/tmp/6fb73f5efeb69286690b8c689598c374-
meta.txt
100
20
20
C%3A%5Cfol1%5Ct1.1
n
getUploadStatusOnFail
Get uploading status when uploading failed (or stopped by user) and the user wants to continue.
Arguments:
The only argument is uploading code that was received with doInitUpload function.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getUploadStatusOnFail/BaSE64EncoDed
DaTA
Success response parameters:
The function returns uploading status the same as function getUploadStatus. Also the function returns
additional info. One of nodes is lastsavedbyte. This value can be used to resume the uploading (if resume
allowed).
Argument names to call this function with alternative method (GET or POST)
uploadcode - Uploading code that was returned with function doInitUpload
doSearchFiles
Searches files, even if the files are stored on different cloud providers.
Arguments:
Search string,
Options – list of chars that defines how to search. Possible values: n – search by file name, d – search by file
description, t – search by tags,e – search by extension (extension must be exact like
search string), p – search in extension (search string can be part of extension), a –
search by any file data. Can be combined (like 'nd' means search by name or
description),
Include shared – (y or n) defined if to search also in shared files (for this user),
Only ids - (y or n) defines if to return all files info or only found files ids,
Show file path - (y or n) if to return also the path of the file in folders.
Type of search – can have 3 values: e - exact phrase, a – all words must be found, o – one of word must be
found
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSearchFiles/BaSE64E,ncoDed,Da,TA
Success response parameters:
The function returns the list of found files.
Argument names to call this function with alternative method (GET or POST)
search - search string
options - options (see above)
includeshared - 'y' or 'n'
onlyids - 'y' or 'n'
showfilepath - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doSearchFiles&
search=t&options=n&includeshared=y&onlyids=n&showfilepath=y
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doSearchFiles/dA==,bg==,eQ==,bg==,eQ
==
Response:
ok
Success
1016967
1012825
4626
t3.jpg
upl_4afa76fc94a78.jpg
jpg
first test file
0
2009-11-11 08:34:04
0
doSearchFiles
doSearchPublicFiles
Searches the public files of all SMEStorage users i.e. files they have designated public which reside on
underlying clouds.
Arguments:
Search string,
Options – list of chars that defines how to search. Possible values: n – search by file name, d – search by file
description, t – search by tags, e – search by extension (extension must be exact
like search string), p – search in extension (search string can be part of extension), a
– search by any file data. Can be combined (like 'nd' means search by name or
description),
Type of search – can have 3 values: e - exact phrase, a – all words must be found, o – one of word must be
found
Return file link – 'y' or 'n'
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSearchPublicFiles/BaSE64E,ncoDed,D
a,TA
Success response parameters:
The function returns the list of found public files.
Argument names to call this function with alternative method (GET or POST)
search - search string
options - options (see above)
type - 'e' or 'a' or 'o'
returnlink - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doSearchPublic
Files&search=t1&options=n&type=a&returnlink=y
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doSearchPublicFiles/dDE=,bg==,YQ==,e
Q==
Response:
ok
Success
I have a Light1.doc
26112
doc
2008-07-08 08:56:05
application/msword
bd6c9bad0217cf6cbbcc9c2b1d1794ca
0
David Aitken
cocdundee
http://smestorage.com/files/bd6c9bad0217cf6cbbcc9c2b1d1794ca.doc
t1
n
y
a
doSearchPublicFiles
getAvaliableFileTemplates
Get the list of available file templates. File templates are used for the creating of a new file. This function
returns the list of all possible file types that can be created.
Arguments:
No arguments.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getAvaliableFileTemplates/
Success response parameters:
The function returns the list of possible file types for creating a file.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getAvaliableFileT
emplates&
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getAvaliableFileTemplates/
Response:
ok
Success
getAvaliableFileTemplates
MS Word
MS Excel
Plain text
HTML document
createNewEmptyFile
Creates empty file by given extension. This enables the creation of MS Office type files that can be then
edited directly, and saved, from the browser using the Zoho integration.
Arguments:
File name,
File extension. This must be one of allowed extensions (see function getAvaliableFileTemplates)
File parent folder id.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/createNewEmptyFile/BaSE64E,ncoDed,D
aTA
Success response parameters:
New file record.
Argument names to call this function with alternative method (GET or POST)
fi_name - file name
fi_extension - file extension
fi_pid - file parent folder id
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=createNewEmpt
yFile&fi_name=t1_new_.txt&fi_extension=txt&fi_pid=1012825
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/createNewEmptyFile/dDFfbmV3Xy50eHQ
=,dHh0,MTAxMjgyNQ==
Response:
ok
Success
createNewEmptyFile
1017089
1012825
4626
t1_new_.txt
upl_4afa91f823472.txt
txt
0
2009-11-11 10:29:10
16
text/plain
793de4ff447174d444fd6b473b0c21d3
0
0
0
0
g
0
0
0
….
0
doFavouriteFile
This Sets/unsets the favourite flag for files. You use this function to add file to favourites or remove a file from
favourites.
Arguments:
File id. Or comma separated list of file ids
File favourite state (1 or 0). If this value is 1 then file will be set favourite, if 0 then unset favourite
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doFavouriteFile/BaSE64E,ncoDed
Success response parameters:
Updated file(s) records.
Argument names to call this function with alternative method (GET or POST)
fi_id - file id
fi_favorite - file favourite state (1 or 0)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doFavouriteFile
&fi_id=1016967&fi_favorite=1
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doFavouriteFile/MTAxNjk2Nw==,MQ==
Response:
ok
Success
1016967
1012825
4626
t3.jpg
upl_4afa76fc94a78.jpg
jpg
first test file
0
2009-11-11 08:34:04
0
image/jpeg
e1076be8ade8a955232117332d164752
0
0
0
0
g
0
1
…….
0
1
doFavouriteFile
getMyFavouriteFiles
Returns a list of favourite files for a user.
Arguments:
No arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getMyFavouriteFiles/
Success response parameters:
The list of files records.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getMyFavouriteF
iles&
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getMyFavouriteFiles/
Response:
ok
Success
1016967
1012825
4626
t3.jpg
upl_4afa76fc94a78.jpg
jpg
first test file
0
2009-11-11 08:34:04
0
image/jpeg
e1076be8ade8a955232117332d164752
0
0
0
0
g
0
1
0
2009-11-11 04:31:48
2009-11-11 08:34:04
0
getMyFavouriteFiles
Folder functions
doCreateNewFolder
Creates a folder within the SMEStorage Cloud File System and also in the underlying cloud if the cloud
provider supports this.
Arguments:
folder name,
folder description,
parent folder id,
structure type (see Structures)
Organization ID. Must be set 1 to create Organization folder by Org admin. Default value is 0.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCreateNewFolder/MTQ4,JKkKKKKJG,J
HkhLK34kHGK,JHG7JH
Success response parameters:
New folder info
Argument names to call this function with alternative method (GET or POST)
fi_name - foldername
fi_description - folderdescription
fi_pid - parentfolderid
fi_structtype - structure type code
fi_isorg - is org folder or not (1 or 0)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doCreateNewFol
der&fi_name=folder1&fi_description=folder_desc&fi_pid=&fi_structtype=g&fi_isorg=0
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doCreateNewFolder/Zm9sZGVyMQ==,Zm
9sZGVyX2Rlc2M=,,Zw==,MA==
Response:
ok
Success
doCreateNewFolder
1017091
0
4626
folder1
folder_desc
1
2009-11-11 10:37:18
0
………….
doRenameFolder
Renames a folder and allows you to change the description
Arguments: folderid,foldername,folderdescription
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRenameFolder/MTQ4,JKkKKKKJG,JHk
hLK34kHGK
Success response parameters:
Altered folder info
Argument names to call this function with alternative method (GET or POST)
fi_id - folderid
fi_name - foldername
fi_description - folderdescription
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doRenameFolde
r&fi_id=1017091&fi_name=folder2&fi_description=desc_for_folder
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doRenameFolder/MTAxNzA5MQ==,Zm9s
ZGVyMg==,ZGVzY19mb3JfZm9sZGVy
Response:
ok
Success
doRenameFolder
1017091
0
4626
folder2
desc_for_folder
1
2009-11-11 10:37:18
0
eadb4ff75656bcf94ee5c9c50952118d
0
0
0
0
g
0
0
0
2009-11-11 04:42:13
2009-11-11 10:37:18
0
doDeleteFolder
Deletes a folder from SMEStorage Cloud file system and the underlying cloud provider if the cloud provider
supports this functionality.
Arguments:folderid
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dcdoDeleteFolder/MTQ4
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
fi_id - folderid
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doDeleteFolder&
fi_id=1017091
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doDeleteFolder/MTAxNzA5MQ==
Response:
ok
Success
doDeleteFolder
1017091
36
262144000
0
0
doMoveFolders
Move folder(s) to another folder.
Arguments: folderids,folderid
folderids can be comma separated list of ids. In this case all folderss will be moved to folder
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doMoveFolders/MTQ4,dG93ZX
Success response parameters:
Moved folders information.
Argument names to call this function with alternative method (GET or POST)
fi_ids - fileid
dir_id - folderid
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doMoveFolders
&fi_ids=1017091&dir_id=1012825
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doMoveFolders/MTAxNzA5MQ==,MTAxMj
gyNQ==
Response:
ok
Success
doMoveFolders
1017091
1
1012825
0
0
Cloud Group and sharing functions
doSendEmail
Send email to a friend with the file download link.
Arguments: fileid,email,fromname,text,days
FileID can be comma separated list of ids. In this case links for each file will be included in email.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSendEmail/MTQ4,dG93ZXIuZ3J2QGdt
YWlsLmNvbQ==,cm9tYW4=,aGVsbG8=,
Success response parameters:
Count of processed files.
Argument names to call this function with alternative method (GET or POST)
fi_id - fileid
friend_email - email
from_name - fromname
text - text
days - days
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doSendEmail&fi
_id=1017089&friend_email=adevikat@gmail.com&from_name=Viking&text=Some_text&days=2
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doSendEmail/MTAxNzA4OQ==,YWRldmlr
YX21haWwuY29t,VmlraW5n,Sm9pbl9pbl93aoX2FfZ3JvdXA=,Mg==
Response:
ok
Ok
adevikat@gmail.com
doSendEmail
doSendEmail
getGroupsList
Return all groups that has the current user as the member
Arguments: no arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getGroupsList/
Success response parameters:
XML structure with data of the database table Groups. Each group item contains substructure with the list of
group members (user id and name)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getGroupsList&
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getGroupsList/
Response:
ok
Success
1
492
4626
group98433
smal_test_group
0
n
viking
4626
0
1
0
4626
getGroupsList
getAllShared
Returns the list of all shared files. Returned data has three lists: files shared by current user, files shared for
current user and folders shared for user (each folder record contains the list of files and subfolders )
Arguments: no arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getAllShared/
Success response parameters:
XML structure with data of the database table Shared.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=getAllShared&
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/getAllShared/
Response:
ok
Success
0
0
0
getAllShared
doCreateGroup
Create new group
Arguments:
group name,
group description,
Group permission. If 0 then all members can submit. If 1 then only group creator can submit,
Is group private ? If „y‟ then group members can not see who are group members. Group member can only
see himself and creator. Group creator can see all members.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCreateGroup/MTQ4,JKkKKKKJG
Success response parameters:
New group info
Argument names to call this function with alternative method (GET or POST)
gr_title - Title of the group
gr_description - Description of the group
gr_permissions - Group permissions
gr_private - 'y' or 'n'. If group is private.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doCreateGroup
&gr_title=group98433&gr_description=smal_test_group&gr_permissions=0&gr_private=n
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doCreateGroup/Z3JvdXA5ODQzMw==,c2
1hbF90ZXN0X2dyb3Vw,MA==,bg==
Response:
ok
Success
doCreateGroup
492
4626
group98433
smal_test_group
0
n
viking
4626
0
1
0
doCreateGroup
doRenameGroup
Edit group info (name and description)
Arguments:
group id,
group name,
group description
Group permission. If 0 then all members can submit. If 1 then only group creator can submit,
Is group private? If „y‟ then group members can not see who are group members. Group member can only
see himself and creator. Group creator can see all members.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRenameGroup/RDtN,MTQ4,JKkKKKKJ
G
Success response parameters:
Updated group info
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
gr_title - Title of the group
gr_description - Description of the group
gr_permissions - Group permissions
gr_private - 'y' or 'n'. If group is private.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doRenameGrou
p&gr_id=492&gr_title=group5a464c6&gr_description=some_descr&gr_permissions=0&gr_private=n
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doRenameGroup/NDky,Z3JvdXA1YTQ2N
GM2,c29tZV9kZXNjcg==,MA==,bg==
Response:
ok
Success
doRenameGroup
492
4626
group5a464c6
some_descr
0
n
doRenameGroup
doDeleteGroup
Delete group. Only the group creator can delete it.
Arguments: groupid
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteGroup/MTQ4
Success response parameters:
Just the status
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=5db8058f8a7c73c60ac6e6f83a17f812&function=doDeleteGroup&
gr_id=493
Alternate request:
http://smestorage.com/api/5db8058f8a7c73c60ac6e6f83a17f812/doDeleteGroup/NDkz
Response:
ok
Success
doDeleteGroup
493
4637
New Group
0
n
doDeleteGroup
doEditGroupUser
Edit group member permissions.
Permissions can be:
0 - inherit from group
1 - Can share files
2 - Can not share files
Arguments:
Group ID,
User ID,
Permission - 0,1 or 2
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doEditGroupUse
r&gr_id=1&us_id=100&us_permissions=1
Success response parameters:
User permissions info .
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
us_id - User ID
us_permissions - permissions
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doEditGroupUse
r&gr_id=492&us_id=4637&us_permissions=1
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doEditGroupUser/NDky,NDYzNw==,MQ==
Response:
ok
Ok
doEditGroupUser
1
4637
492
doEditGroupUser
doInviteToGroup
Send email to a friend / colleague with the link to become a member of a business group.
Arguments: group id,email,from name, text
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doInviteToGroup/MTQ4,dG93ZXIuZ3J2Q
GdtYWlsLmNvbQ==,cm9tYW4=
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
friend_email - email
from_name - from name
text - text
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doInviteToGroup
&gr_id=492&friend_email=user_987asd@gmail.com&from_name=Viking&text=Some_text
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doInviteToGroup/NDky,YWRldmlrYX54sd2
1haWwuY89t,VmlraW5n,U29tZV90ZXh0
Response:
ok
Ok
986a414665410423ceb6be4929ba9657
user_987asd@gmail.com
986a414665410423ceb6be4929ba9657
doInviteToGroup
doRepeatInvitation
Repeat email to friend with link to become a member of a business group. This is useful if there are
outstanding group requests.
Arguments:
invitation code. This code can be obtained from list of invitations returned by getGroupsList. This is gr_code
field value.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getGroupsList/MTQ4dG93
Success response parameters:
Returns info about invitation (group and user data).
Argument names to call this function with alternative method (GET or POST)
gr_code - invitation code
Example.
Request example:
http://smestorage.com/api/rpc.php?token=f4eb73cea4b3b25261d63cf9e9c326a7&function=doRepeatInvitati
on&gr_id=492
Alternate request:
http://smestorage.com/api/f4eb73cea4b3b25261d63cf9e9c326a7/doRepeatInvitation/NDky
Response:
ok
Ok
doRepeatInvitation
doRepeatInvitation
doAcceptInvitation
Accept or refuse invitation to the business group.
Arguments: invitation code, acceptance (y or n)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doAcceptInvitation/dG93ZXIuZ3J2QGdtY
WlsLmNvbQ==,cm9tYW4=
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
gr_code - Code of the invitation
Example.
Request example:
http://smestorage.com/api/rpc.php?token=fb9f76ceee47d889c546203cca42b2cc&function=doAcceptInvitatio
n&gr_code=6361930b2211a54491d80dfbd7d7b20a&acceptance=y
Alternate request:
http://smestorage.com/api/fb9f76ceee47d889c546203cca42b2cc/doAcceptInvitation/NjM2MTkzMGIyMjExYT
U0NDkxZDgwZGZiZDdkN2IyMGE=,eQ==
Response:
ok
Ok
n
doAcceptInvitation
doDeleteInvitation
Deletes invitation. Only user that created the invitation can delete it.
Arguments:
invitation code. This code can be get from list of invitations returned by getGroupsList. This is gr_code field
value.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteInvitation/MTQ4dG93
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
gr_code - invitation code
Example.
Request example:
http://smestorage.com/api/rpc.php?token=f6a6bcdb2168353e2ebf11994b5d9693&function=doDeleteInvitatio
n&gr_id=5305f1b69b60fead8f170f4a781821c8
Alternate request:
http://smestorage.com/api/f6a6bcdb2168353e2ebf11994b5d9693/doDeleteInvitation/NTMwNWYxYjY5YjYwZ
mVhZDhmMTcwZjRhNzgxODIxYzg=
Response:
ok
Ok
doDeleteInvitation
doDeleteInvitation
doShareFileWithGroup
Share the file with the group or the user.
Arguments: group id, file id, count of days, comment, user id
If user id is 0 then file are shared with all members of the group otherwise only with specified user. If count
of days is 0 or empty then sharing is unlimited in time. If the count is specified then this is the number of days
that the link will be active before expiring.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doShareFileWithGroup/MTQ4,dG93ZX,d
G93ZXIuZ3J2QGdtYWlsLmNvbQ==,cm9tYW4=
Success response parameters:
Shared file record.
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
fi_id - File ID
gr_expired - Count of days (or 0 if unlimited)
gr_comment - Comment
us_id - User ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=2e9db43db3a059bad2026f67ec25f2d9&function=doShareFileWith
Group&gr_id=492&gr_expired=0&gr_comment=some_comment&us_id=0
Alternate request:
http://smestorage.com/api/2e9db43db3a059bad2026f67ec25f2d9/doShareFileWithGroup/NDky,MA==,c29tZ
V9jb21tZW50,MA==
Response:
ok
Success
5714
0
492
0
0
some_comment
0
5714
0
492
0
some_comment
0
……….
1
doShareFileWithGroup
doShareFolderWithGroup
Share the folder with the business group or the user.
Arguments: group id, folder id, count of days, comment, user id, sharesubfolders
If user id is 0 then file are shared with all members of the group otherwise only with specified user. If count
of days is 0 or empty then sharing is unlimited in time. If the count is specified then this is the number of days
that the link will be active before expiring.
Argument sharesubfolders can have values y or n . If y then subfolders are shared too.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doShareFileWithGroup/MTQ4,dG93ZX,d
G93ZXIuZ3J2QGdtYWlsLmNvbQ==,cm9tYW4=
Success response parameters:
Shared folder record with all files and subfolders (if subfolders are shared).
Argument names to call this function with alternative method (GET or POST)
gr_id - Group's ID
fi_id - File ID
gr_expired - Count of days (or 0 if unlimited)
gr_comment - Comment
us_id - User ID
sharewithsunfolders - Check if to share subfolders (y or n)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=bfa1b2b0792a634ca5791f6da7bd504c&function=doShareFolderW
ithGroup&gr_id=492&fi_id=1012825&gr_expired=0&gr_comment=Some_comment&us_id=&sharewithsunfol
ders=y
Alternate request:
http://smestorage.com/api/bfa1b2b0792a634ca5791f6da7bd504c/doShareFolderWithGroup/NDky,MTAxMjgy
NQ==,MA==,U29tZV9jb21tZW50,,eQ==
Response:
ok
Success
5715
0
492
1012825
0
Some_comment
2
5715
0
492
1012825
0
Some_comment
2
viking
4626
0
4626
My Music
1
2009-11-10 12:22:20
0
b6b689c12fef89fcaa3b8ace725e6350
0
0
0
…………..
4
1
doShareFolderWithGroup
doDeleteShared
Delete shared file from shared files list (note: not delete the actual file itself).
Arguments: shared item id
If a shared file was shared by the current user then it is deleted and is no longer accessible by other users. If
a user deletes a shared file (that was shared for him by another user) then the file will be deleted just for him,
not for other business group members.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteShared/MTQ4
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
gr_sharedid - ID of shared item
Example.
Request example:
http://smestorage.com/api/rpc.php?token=bfa1b2b0792a634ca5791f6da7bd504c&function=doDeleteShared
&gr_sharedid=1012825
Alternate request:
http://smestorage.com/api/bfa1b2b0792a634ca5791f6da7bd504c/doDeleteShared/MTAxMjgyNQ==
Response:
ok
Success
doDeleteShared
doDeleteShared
doUnsubscribeGroup
Unsubscribe user from the business group
Arguments: user id, group id
Group creator can‟t unsubscribe itself. Only the group creator can unsubscribe users. Any user can
unsubscribe itself (except the creator).
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doUnsubscribeGroup /MTQ4,WT5F
Success response parameters:
Status
Argument names to call this function with alternative method (GET or POST)
gr_id - group identifier
us_id - user identifier
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=doUnsubscribeG
roup&gr_id=494&us_id=4626
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/doUnsubscribeGroup/NDk0,NDYyNg==
Response:
ok
Ok
doUnsubscribeGroup
494
y
4626
0
doUnsubscribeGroup
doRequestFile
Request file from a business group user. The user receives an email in which he is requested to share a file
with the business group.
Arguments:
3 arguments: user id, group id, comment
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRequestFile/TRG,HGt,LKLKHLKHK
Success response parameters:
The function returns nothing. Just success or no.
Argument names to call this function with alternative method (GET or POST)
us_id - ID of the user to request file
gr_id - ID of the group in witch file is requested
comment - Comment
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=doRequestFile&
us_id=4626&gr_id=495&comment=Give_me_a_file
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/doRequestFile/NDYyNg==,NDk1,R2l2ZV9
tZV9hX2ZpbGU=
Response:
ok
Ok
doRequestFile
doPublicFile
Set or unset a file as public. A public file can be viewed by anyone on the Internet.
Arguments: file id, public state (0 or 1)
file id can be the list if comma separated ids of files.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doPublicFile /MTQ4,HTF4
Success response parameters:
The list of changed files
Argument names to call this function with alternative method (GET or POST)
fi_id - File ID
fi_public - 1 or 0. Public or not.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=doPublicFile&fi_i
d=1017126&fi_public=1
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/doPublicFile/MTAxNzEyNg==,MQ==
Response:
ok
Success
doPublicFile
1017126
0
4637
t3.jpg
upl_4afabf1125e4d.jpg
jpg
0
2009-11-11 13:41:44
12
image/jpeg
c1a267880c83420384666b5ad36e6e25
1
0
0
0
g
0
0
…………..
0
1
doPublicFile
getAutoshareRules
Returns a list of autosharing rules. Auto-sharing rules are information about a file, folder, file extension or
whole file-tree that outline what watches should be set.
Arguments: no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getAutoshareRules/MTQ4,HTF4
Success response parameters:
The list of rules
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=getAutoshareRul
es&
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/getAutoshareRules/
Response:
ok
Success
getAutoshareRules
87
4637
492
4626
Some_rule
0
getAutoshareRules
doAddAutoShareRule
Add a new rule for autosharing.
Arguments:
Group ID to autoshare file for,
User ID to autoshare file for. If 0 then for all group members,
Rule – the text that file name (or another info) must contain to be shared,
Rule type – the list of file attributes that must contain rule text. Allowed: fi_name – file name,
fi_extension – file extension, fi_description – description. Example:
fi_name,fi_extension,fi_description . Example 2: fi_name
Folder id where rule works. If 0 then root folder.
Include subfolders – y or n. If y then rule works also in subfolders of rule folder.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doAddAutoShareRule/MTQ4,HTF4,JhtY,L
KJJKH,KJ,KLJL,LKJ
Success response parameters:
New rule info.
Argument names to call this function with alternative method (GET or POST)
gr_id - group ID
us_id - user ID
rl_rule - rule text
rl_type - rule type
rl_folder - rule folder
rl_subfolders - use subfolders
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=doAddAutoShar
eRule&gr_id=492&us_id=4626&rl_rule=Some_rule
&rl_type=fi_name,fi_extension,fi_description&rl_folder=0&rl_subfolders=y
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/doAddAutoShareRule/NDky,NDYyNg==,U
29tZV9ydWxlIA==,ZmlfbmFtZSxmaV9leHRlbnNpb24sZmlfZGVzY3JpcHRpb24=,MA==,eQ==
Response:
ok
Ok
doAddAutoShareRule
87
4637
492
4626
Some_rule
0
doAddAutoShareRule
doDeleteAutoShareRule
Deletes autoshare rule. Auto-sharing rules are information about a file, folder, file extension or whole file-tree
that outline what watches should be set.
Arguments:
Rule id
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteAutoShareRule/MTQ4
Success response parameters:
Just status
Argument names to call this function with alternative method (GET or POST)
rl_id - rule ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=a03d81a19daa339b59bae6e59ef3fbc4&function=doDeleteAutoSh
areRule&rl_id=87
Alternate request:
http://smestorage.com/api/a03d81a19daa339b59bae6e59ef3fbc4/doDeleteAutoShareRule/ODc=
Response:
ok
Ok
doDeleteAutoShareRule
87
4637
492
4626
Some_rule
0
doDeleteAutoShareRule
Email backup functions
getEmailAccounts
Returns the list of all email accounts for a user.
Arguments: no arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ getEmailAccounts/
Success response parameters:
XML structure with data of the database table EmailAccounts.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=getEmailAccou
nts&
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/getEmailAccounts/
Response:
ok
Success
1
161
firstEmAcc
pop.gmail.com
user_87
userpass897
995
4626
1017134
y
pop3
1012939
getEmailAccounts
doCheckEmailAccountSettings
Check email account settings. This function is used to check if user entered valid IMAP/POP3 data before
adding a new email account.
Arguments:
Host of email server
Account user name
Account password
Account port
'y' or 'n' to check if server uses sequre connection.
Account type – imap or pop3
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCheckEmailAccountSettings/MTQ4,JKk
KKKKJG,JHG56GH,H3GH
Success response parameters:
Return item 'connected' indicates if connection were established. If is 0 then it was not established. In this
case item 'errormessage' contains the error message.
Argument names to call this function with alternative method (GET or POST)
em_host - account pop3 host
em_username - account pop3 username
em_password - account pop3 password
em_port - account pop3 port
em_tsl - 'y' or 'n'. If connection is sequre
em_type - type of connection (imap or pop3)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doCheckEmailA
ccountSettings&em_host=pop.gmail.com&em_username=user_87&em_password=userpass897&em_port=9
95&em_tsl=y&em_type=pop3
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doCheckEmailAccountSettings/cG9wLmd
tYWlsLmNvbQ==,a29zdHlya2844Whvcg==,dmlrad5na29zd25ya282NjYxMw==,OTk1,eQ==,cG9wMw==
Response:
ok
Success
1
doCheckEmailAccountSettings
doCreateEmailAccount
Create a new email account
Arguments:
account name
pop3/imap host
pop3/imap username
pop3/imap password
pop3/imap port
pop3/imap sequre connection ('y' or 'n')
type of connection (imap or pop3)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCreateEmailAccount/MTQ4,JKkKKKKJ
G,JHG56GH,H3GH
Success response parameters:
New account info
Argument names to call this function with alternative method (GET or POST)
em_name - account name
em_host - account pop3 host
em_username - account pop3 username
em_password - account pop3 password
em_port - account pop3 port
em_tsl - sequre connection ('y' or 'n')
em_type - type of connection (imap or pop3)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doCreateEmail
Account&em_name=firstEmAcc&em_host=pop.gmail.com&em_username=user_87&em_password=
userpass897&em_port=995&em_tsl=y&em_type=pop3
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doCreateEmailAccount/Zmlyc3RFbUFjYw
==,cG9wLmdtYWlsLmNvbQ==,a29zdH65as4d2s5cg==,dma56s4na654sdf54NjYxMw==,OTk1,eQ==,cG9wM
w==
Response:
ok
Success
161
firstEmAcc
pop.gmail.com
user_87
userpass897
995
4626
1017134
y
pop3
1017134
1012939
4626
firstEmAcc
To store backups for email account user_87 on pop.gmail.com
1
2009-11-11 15:23:24
0
ad15d46fa4f7c7f44630f74fa1514c1c
0
0
0
0
e
0
0
0
2009-11-11 15:23:24
2009-11-11 15:23:24
0
doCreateEmailAccount
doEditEmailAccount
Email account information
Arguments:
account id
account name
pop3 host
pop3 username
pop3 password
pop3 port
pop3/imap sequre connection ('y' or 'n')
type of connection (imap or pop3)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doEditEmailAccount /
MTQ4,JKkKKKKJG,JHG56GH,H3GH
Success response parameters:
Updated account info
Argument names to call this function with alternative method (GET or POST)
em_id - account id
em_name - account name
em_host - account pop3 host
em_username - account pop3 username
em_password - account pop3 password
em_port - account pop3 port
em_tsl - sequre connection ('y' or 'n')
em_type - type of connection (imap or pop3)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doEditEmailAcc
ount&em_id=161&em_name=firstEmAcc&em_host=pop.gmail.com&em_username=user_87&em_password
=userpass897&em_port=995&em_tsl=y&em_type=pop3
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doEditEmailAccount/MTYx,Zmlyc3RFbUF
jYw==,cG9wLmdtYWlsLmNvbQ==,dXNlcl84Nw==,dXNlcnBhc3M4OTc=,OTk1,eQ==,cG9wMw==
Response:
ok
Success
161
firstEmAcc
pop.gmail.com
user_87
userpass897
995
4626
1017134
y
pop3
1017134
1012939
4626
firstEmAcc
To store backups for email account user_87 on pop.gmail.com
1
…………
0
doEditEmailAccount
doDeleteEmailAccount
Delete email account.
Arguments: account id
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doDeleteEmailAccount /MTQ4
Success response parameters:
Deleted account info
Argument names to call this function with alternative method (GET or POST)
em_id - account id
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doDeleteEmailA
ccount&em_id=163
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doDeleteEmailAccount/MTYz
Response:
ok
Success
163
firstEmAcc2
pop.gmail.com
user_87
userpass897
995
4626
1017136
y
pop3
doDeleteEmailAccount
doBackupEmailBox
Backup emails from email account. This function is no longer supported. See descriptions of functions
getAmountOfEmails and the description of email backups.
Arguments: account id
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doBackupEmailBox /MTQ4
Success response parameters:
Amount of backuped emails
Argument names to call this function with alternative method (GET or POST)
em_id - account id
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doBackupEmail
Box&em_id=161
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doBackupEmailBox/MTYx
Response:
ok
Success
0
161
firstEmAcc
pop.gmail.com:995
user_87
userpass897
995
4626
1017134
y
pop3
doBackupEmailBox
doBackupEmailBoxInBackground
Add email box backup task to background tasks. Status of the backup can be obtained with the background
tasks functions.
Arguments: account id
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/ doBackupEmailBox /MTQ4
Success response parameters:
Just status.
Argument names to call this function with alternative method (GET or POST)
em_id - account id
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doBackupEmail
BoxInBackground&em_id=161
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doBackupEmailBoxInBackground/MTYx
Response:
ok
Success
doBackupEmailBoxInBackground
getAmountOfEmails
Get amount of emails in mailbox. This is the initial procedure for email backups. When calling this function it
is possible to define what IMAP folders must be processed. To get existent IMAP folders function
getEmailAccountFolders can be used.
Arguments:
Emailbox ID;
Unique code (optional, can be empty)
Folders list: comma separated list of IMAP folders. (Ex. INBOX,INBOX.Sent,INBOX.Trash)
option that says what to do with folders list – use these folders or exclude. If value is 'I' then use listed
folders, if value is 'e' then exclude ilsted folders.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getAmountOfEmails/TRG
Success response parameters:
The function returns:
Total count of emails, emailbox account info and uniquecode string. Uniquecode must be used as argument
in each call of function doBackupEmail. It is needed for backuping session (see below).
Also list of IMAP folders and count of emails in each folder is returned.
Argument names to call this function with alternative method (GET or POST)
em_id - ID of emailbox
uniquecode - Unique string. Can be missed. In this case function generate this string for future using.
folders - list of folders
incorexc - include or exclude folders from backup ('I' or 'e')
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=getAmountOfE
mails&em_id=161&uniquecode=&folders=INBOX.Sent&incorexc=I
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/getAmountOfEmails/MTYx,,SU5CT1guU2
VudA==,SQ==
Response:
ok
Success
1
INBOX
1
1
161
firstEmAcc
pop.gmail.com
………….
995
4626
1017134
y
pop3
5aa848bfc6a90c773fc36a1a55de019b
getAmountOfEmails
getEmailAccountFolders
Return IMAP folders for an email account. If this account is not IMAP type (is POP3) then only 1 – INBOX
folder will be returned. Folders returned with this function are used when calling function getAmountOfEmails
to define what IMAP folders will be backed up.
Arguments:
The only argument is emailbox ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getEmailAccountFolders/TRG
Success response parameters:
The function returns the list of IMAP folders.
Argument names to call this function with alternative method (GET or POST)
em_id - ID of emailbox
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=getEmailAccou
ntFolders&em_id=161
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/getEmailAccountFolders/MTYx
Response:
ok
Success
INBOX
1
getEmailAccountFolders
doBackupEmail
Backups email specified with number.
Arguments:
4 arguments: Email box ID, email number, parent folder id, uniquecode, subject format, IMAP folder
email number – in case if last argument ('IMAP folder') this value is number from 1 to number returned with
function getAmountOfEmails . This function must be called for each email separately.
If 'IMAP folder' is not empty then this number is number of email within IMAP folder.
parent folder id – id of folder where backuped email file will be saved. When you call this function first time
you can leave this parameter empty. In this case folder will be created to store all
email from this mailbox during current backup. Function will return ID of created
folder and you can use this id for next calling (from 2-nd email).
Uniquecode – value returned with getAmountOfEmails function.
Subject format – if this value is base64 then subject of just backuped email will be returned in base64
encoded format. In other case – no any encoding.
IMAP folder – name of IMAP folder from witch email will be backuped. For POP3 account this argument can
be ignored.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doBackupEmail/TRG,HGt,LJ7,LKLKHLKH
K
Success response parameters:
The function returns:
Backupdirectory – ID of folder where email was saved. If this value was sent with arguments then it is the
same if not then folder is created and ID is returned.
Wasconnect – if connection to mailbox was success and email is uploaded from pop3 server
Subject – subject of just backuped email
Argument names to call this function with alternative method (GET or POST)
em_id - ID of emailbox
email - email number. From 1 to count of emails
fi_pid - id of folder. Can be missed if „email‟ is 1
uniquecode - unique string returned with getAmountOfEmails
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doBackupEmail
&em_id=161&email=1&fi_pid=&uniquecode=5aa848bfc6a90c773fc36a1a55de019b
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doBackupEmail/MTYx,MQ==,,NWFhODQ
4YmZjNmE5MGM3NzNmYzM2YTFhNTVkZTAxOWI=
Response:
ok
Success
1
1017139
tests
doBackupEmail
doZipBackupedEmailBox
Create mbox file from all backed up emails. If there were more then 1 IMAP folder backed up then separate
mbox file for each folder will be created.
Arguments:
3 arguments: Email box ID, parent folder id, uniquecode
parent folder id – id of folder where zip will be saved. This is ID returned with doBackupEmail function.
Uniquecode – value returned with getAmountOfEmails function.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doZipBackupedEmailBox/TRG,HGt,LKLK
HLKHK
Success response parameters:
The function returns count emails added to mbox files and account info.
Argument names to call this function with alternative method (GET or POST)
em_id - ID of emailbox
fi_pid - id of folder
uniquecode - unique string returned with getAmountOfEmails
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doZipBackuped
EmailBox&em_id=161&fi_pid=&uniquecode=5aa848bfc6a90c773fc36a1a55de019b
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doZipBackupedEmailBox/MTYx,,NWFhO
DQ4YmZjNmE5MGM3NzNmYzM2YTFhNTVkZTAxOWI=
Response:
ok
Success
1
1
161
firstEmAcc
pop.gmail.com
…………..
995
4626
1017134
y
pop3
doZipBackupedEmailBox
Fax functions
doFaxDocuments
Fax documents. Note that an Interfax account is needed for Faxing.
Arguments: file ids, recipients, faxheader
file ids can be the list if comma separated ids of files.
Recipients – the list of fax numbers (enter (return , “\n”) splitted ). Numbers must start with “+” symbol.
Faxheader – any string (can be empty)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doFaxDocuments/MTQ4,HTF4GJHG,KJG
KJFKJ
Success response parameters:
The list of faxed files. Also the list of files where error occurred.
Argument names to call this function with alternative method (GET or POST)
fi_id - file id or comma separated ids
recipients - „return‟ separated list of recipients
faxheader - fax header
Example.
Request example:
http://smestorage.com/api/rpc.php?token=786044d2744dfa923a501d9cfc9f5ddc&function=doFaxDocuments
&fi_id=550320&recipients=+0305566130&faxheader=
Alternate request:
http://smestorage.com/api/786044d2744dfa923a501d9cfc9f5ddc/doFaxDocuments/NTUwMzIw,KzAzMDU1N
jYxMzA=,
Response:
ok
Success
doFaxDocuments
550320
550320
550320
getFaxesList
Get list of documents that are in temporary list prepared for faxing. Note an Interfax account is needed for
faxing.
Arguments: faxes list type - indicates if to list only ids or all files data
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFaxesList/HJGJ
Success response parameters:
The list of files ids.
Argument names to call this function with alternative method (GET or POST)
faxeslisttype - „s‟ or „e‟ . if „e‟ then all files data will be returned. If „s‟ or nothing then only ids
will be returned.
doAddToMyFaxes
Add (delete) document(s) to (from) temporary list of documents for faxing. Note an Interfax account is
needed for faxing.
Arguments: file ids, flag (add/delete)
file ids can be the list if comma separated ids of files.
Flag can be “y” if delete documents from the list or any other value if to add to the list.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doAddToMyFaxes/MTQ4,HTF4GJHG
Success response parameters:
The list of files added/deleted to/from the list. Also the flag that indicates if there was deleting or adding.
Argument names to call this function with alternative method (GET or POST)
fi_id - file id or comma separated ids
delete - if „y‟ then files will be deleted from list. If any another value then files
will be added
Example.
Request example:
http://smestorage.com/api/rpc.php?token=1866e644063650900eb99070d26af662&function=doAddToMyFax
es&fi_id=1016968&delete=n
Alternate request:
http://smestorage.com/api/1866e644063650900eb99070d26af662/doAddToMyFaxes/MTAxNjk2OA==,bg==
Response:
ok
Success
doAddToMyFaxes
1016968
1
Filter functions
getFilesFilter
Returns filter if it was set by user
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFilesFilter/
Success response parameters:
The function returns filter info and node that is 1 if filter is set and 0 if no.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=getFilesFilter&
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/getFilesFilter/
Response:
ok
Success
getFilesFilter
1
4626
f
a
f
g
0
0
0
0
doSetFilesFilter
Set/update files filter.
Arguments:
3 arguments:
Target - filter object type: files or folders. d – folders, f – files;
Type - filter type: a – filter by first letter in the name of the object, s – substring in the name (tag) of the
object, n – range.
Data - filter data. For type „a‟ it must be upper case letter or „_‟ that means „not letter‟, for „s‟ it must be
string, for „n‟ - 2 comma splited numbers
Structures - structures type that files is affected on. It is comma separated list of structure codes.
g – general structure, e – email backups, s – My Syncs. Ex. This argument is g. The filter will only
work for general files and will pass all files that are in email backups node or My Syncs node. (also see
Structures). If empty then filer works for all structures.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSetFilesFilter/TR,Gt,JGygjh
Success response parameters:
The function returns new filter info.
Argument names to call this function with alternative method (GET or POST)
fl_target - filter target (d or f)
fl_type - filter type (a,s,or n)
fl_data - filter data
fl_structtype - structure type codes, comma splitted. Ex. g,e . If empty then filer
works for all structures
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doSetFilesFilter
&fl_target=f&fl_type=a&fl_data=f&fl_structtype=g
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doSetFilesFilter/Zg==,YQ==,Zg==,Zw==
Response:
ok
Success
doSetFilesFilter
4626
f
a
f
g
doDeleteFilesFilter
Deletes files filter if it was set by user
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteFilesFilter/
Success response parameters:
Nothing. Just status.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doDeleteFilesFil
ter&
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doDeleteFilesFilter/
Response:
ok
Success
doDeleteFilesFilter
Trash functions
getTrash
Returns the list of files and folders that are in trash.
Arguments:
Folder id (optional) – this argument can be used when it is needed to get only the list of trash files/folders
that are (were) placed in some folder.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getTrash/
Success response parameters:
The function returns the list of files similar to list that is returned with getFilesList function.
Argument names to call this function with alternative method (GET or POST)
fi_id - parent folder id (optional)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=getTrash&
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/getTrash/
Response:
ok
Success
getTrash
4
1013219
1012825
4626
new_name
upl_4af9a908a7e1a.1
1
description_for_file
0
2009-11-10 17:55:20
0
application/octet-stream
5b851bb38eabaf38a7ebac46b414b5e6
0
0
0
0
g
0
0
…………..
0
0
2009-11-11 02:32:51
doDeleteFromTrash
Deletes specified files/folders from trash. If files/folders are not specified then all trash content is deleted
(clear trash)
Arguments:
Files/folders ids (comma splitted)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doDeleteFromTrash/
Success response parameters:
The list of deleted files/folders
Argument names to call this function with alternative method (GET or POST)
fi_id - comma splitted list of files/folders (or just id of file/folder). Is optional.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doDeleteFromTr
ash&fi_id=1017136
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doDeleteFromTrash/MTAxNzEzNg==
Response:
ok
Success
1017136
1012939
4626
firstEmAcc2
To store backups for email account user_87 on pop.gmail.com
1
2009-11-11 15:47:17
…….
1
doDeleteFromTrash
545
262144000
mbox
1
1257978249
1
1
doRestoreFromTrash
Restores specified files/folders from trash. If files/folders are not specified then all trash content is restored
and trash cleared
Arguments:
Files/folders ids (comma splitted)
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRestoreFromTrash/
Success response parameters:
The list of restored files/folders
Argument names to call this function with alternative method (GET or POST)
fi_id - comma splitted list of files/folders (or just id of file/folder). Is optional.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doRestoreFrom
Trash&fi_id=1017135
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doRestoreFromTrash/MTAxNzEzNQ==
Response:
ok
Success
1017135
1012939
4626
firstEmAcc2
To store backups for email account user_login on pop.gmail.com
1
2009-11-11 15:35:44
0
d2470ac71efba4e5c51945657887aaa4
0
0
0
0
e
0
0
0
2009-11-11 15:35:44
2009-11-11 15:35:44
0
1
doRestoreFromTrash
Provider functions
getProviders
Returns the list of allowed cloud storage providers types for the user‟s package. Also returns the list of
already used provider accounts.
Provider types are S3, Mosso (RackSpace), Box.Net, FTP, Gmail, Email, WebDav, SkyDrive, MobileMe. This
list can be extended in the future.
Some packages have only 1 provider type allowed. Some have more.
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getProviders /
Success response parameters:
Returns 2 lists.
allowed node is the list of allowed cloud storage providers types. pr_id is the is of provider type.
used node is the list of used providers. In this list pi_id is the id of provider.
Also returns default provider id and max amount of provider to be used.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=getProviders&
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/getProviders/
Response:
ok
Success
getProviders
0
SMEStorage
DefaultStorageProvider
y
1
0
0
default
n
n
…………
1
0
doProviderSync
Synchronise files in cloud provider account and SMEStorage DB. This function usually must be called more
then 1 time, because sync is split for iterations if there are a couple of files in provider. Special string – status
data – is returned with function call and must be post with next function calling. The function must be called
while sync is not completed (special value returned).
Arguments:
Provider account ID and status data. Status data is empty for first call.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doProviderSync/YTH=,LKJHKLHLKHLKH
LKTYLJTHGKJT
Success response parameters:
Returns info about synced files and status data string that must be used for next calling of this function.
It is needed to check value of response structure node iscompleted . If value is 0 then sync is not completed
and this function must be called again. In this case statusdata node value must be post as 2-nd argument. If
iscompleted is 1 then all files are synced.
Also functions returns 3 lists: new files, updated files and deleted files in this iteration.
And the last returned value is amount of processed files. NOTE: this is amount of processed files in this
iteration, not over all process.
Argument names to call this function with alternative method (GET or POST)
pi_id - id of provider to sync
statusdata - the string returned with previous call of this function. If it is the first call then
this argument is empty.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doProviderSync
&pi_id=&statusdata=
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doProviderSync/,
Response:
ok
Success
doProviderSync
bnVsbA==
1
0
0
doProviderSyncInBackground
Synchronise files in cloud provider account and SMEStorage DB in background. This is alternative for
function doProviderSync. Once doProviderSyncInBackground is called sync starts on background.
Arguments:
Provider account ID
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doProviderSyncInBackground/YTH=
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
pi_id - id of provider to sync
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doProviderSync
InBackground&pi_id=1
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doProviderSyncInBackground/MQ==
Response:
ok
Success
doProviderSyncInBackground
doRemoveProvider
Removes provider from SMEStorage. All files are removed from SMEStorage DB. But files are not removed
from their storage location and can be accessed without SMEStorage.
Arguments:
Provider ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doRemoveProvider/HMT=
Success response parameters:
Deleted provider info.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=doRemoveProvi
der&pi_id=1548
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/doRemoveProvider/M5faQ==
Response:
ok
Success
doRemoveProvider
0
getAddProviderMetaFields
Returns the list of data fields that must be provided to create new provider of given type. Usually these are 2
fields – login and password. For some provider types it is needed to provider more fields (like for Email or
FTP). This function returns list of fields, titles and descriptions.
This function is called before the creation of a new provider.
Arguments:
Provider type ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getAddProviderMetaFields/HMT=
Success response parameters:
The list of fields.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=aa32026242e9707d02c85d010d43fb10&function=getAddProvider
MetaFields&pi_id=1
Alternate request:
http://smestorage.com/api/aa32026242e9707d02c85d010d43fb10/getAddProviderMetaFields/MQ==
Response:
ok
Success
getAddProviderMetaFields
SMEStorage
provider_login
SMEStorage account login
provider_password
SMEStorage account password
doAddProvider
Adds new provider. This iss called a few times (steps).
0 step – provide provider access data;
1 step – select buckets (only for S3 and Mosso);
2 step – chose if to save provider info (only for packages where 1 provider allowed);
3 step – do final saving of provider.
NOTE: bucket means bucket in Amazon S3 service. I case of Mosso bucket means container.
Arguments:
Provider type ID.
Step number.
Next arguments are related from the step.
If step is 0 then arguments are:
Data – special formatted string with provider access info (see below about format)
If step is 1 then arguments are:
Default bucket;
Buckets list (comma separated). The list of buckets that are used to work with files from smestorage.
New bucket name. Is provider when user want to create new bucket and use it as default
If step is 2 then arguments are:
„y‟ or „n‟. If to save access info. If access info is not saved then user will must to enter it each time he login to
SMEStorage.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doAddProvider/HMT=
Success response parameters:
For all steps function returns next step number (whatnextcode item). And next step description.
Another returned data are related to step.
For step 0:
Success or not. If provider type is S3 or Mosso then also buckets list will be returned. It is used for step 1.
For step 1 and 2:
Just success or not.
For step 3:
Created provider info.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
step - step number
Next arguments are related from the step.
If step is 0 then arguments are:
data - special formatted string with provider access info (see below about format)
If step is 1 then arguments are:
defaultbucket - default bucket name;
buckets - the list of buckets. Comma seperated;
createnew - new bucket name;
If step is 2 then arguments are:
savemyinfo - „y‟ or „n‟. If to save provider info.
Format of the data field for step 0.
fieldname1=value1fieldname2=value2…fieldnameN=valueN
These are pairs of fieldname=fieldvalue joined with symbol (usually marked with „\n‟).
Example:
provider_login=mygmaillogin
provider_password=mygmailpassword
Example.
Request example:
http://smestorage.com/api/rpc.php?token=30138de44a9aa8d252a1974897a85ba4&function=doAddProvider
&pr_id=Mg==&step=MA==&data=cHJv7mlk5JfbG9naW49a22zdHlya5as4dWhgcgpwbm9haWglclrwfg12aWd
f0eXJr22djEz
Alternate request:
http://smestorage.com/api/30138de44a9aa8d252a1974897a85ba4/doAddProvider/Mg==,MA==,cHJv7mlk5J
fbG9naW49a22zdHlya5as4dWhgcgpwbm9haWglclrwfg12aWdf0eXJr22djEz
Response:
ok
Success
doAddProvider
Do you want to save your access info?
2
Example.
Request example:
http://smestorage.com/api/rpc.php?token=30138de44a9aa8d252a1974897a85ba4&function=doAddProvider
&pr_id=2&step=3&savemyinfo=y
Alternate request:
http://smestorage.com/api/30138de44a9aa8d252a1974897a85ba4/doAddProvider/Mg==,Mw==,eQ==
Response:
ok
Success
doAddProvider
That is all. Now you can sync your files.
-1
3623
usr_pro_login
usr_pro_pass
1548
2
0
[]
0
0
0
0
doSetDefaultProvider
Set provider to be the default
Arguments:
Provider ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSetDefaultProvider/HMT=
Success response parameters:
Default provider id
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doSetDefaultPro
vider&pi_id=1548
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doSetDefaultProvider/MTU0OA==
Response:
ok
Success
doSetDefaultProvider
1548
doSetMasterCopy
Set or unset provider as the golden „copy‟ of data that will be used for sync with a provider.
Arguments:
Provider ID.
„y‟ or „n‟ value. If provider should be master or not.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSetMasterCopy/HMT=
Success response parameters:
Provider id and boolean value if provider is master
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
master - „y‟ or „n‟. If provider should be master or not.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doSetMasterCo
py&pi_id=1548&master=n
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doSetMasterCopy/MTU0OA==,bg==
Response:
ok
Success
doSetMasterCopy
1548
n
getProviderBuckets
List provider buckets. This is used only for S3 or Mosso (RackSpace). For Mosso (RackSpace) bucket
means container.
Arguments:
Provider ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getProviderBuckets/HMT=
Success response parameters:
Fucntion returns the list of all provider buckets with mark („y‟ or „n‟) that defines if this bucket is used in
SMEStorage. Also default bucket is returned. Default bucket is not included in list of buckets.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=getProviderBuck
ets&pi_id=1549
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/getProviderBuckets/MTU0OQ==
Response:
ok
Success
getProviderBuckets
romasoft
n
smestorage
y
………
doUpdateBucketsList
Updates the list of buckets that is used in the SMEStorage. This is used only for S3 or Mosso (RackSpace).
For Mosso (RacksSpace) bucket means container.
Arguments:
Provider ID.
Comma separated list of buckets.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doUpdateBucketsList/HMT=
Success response parameters:
Function returns the list of provider buckets that are used in SMEStorage. Default bucket is not included in
this list.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
buckets - Comma separated list of buckets.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doUpdateBucket
sList&pi_id=1549&buckets=smestorage,romasoft
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doUpdateBucketsList/MTU0OQ==,c21lc3
RvcmFnZSxyb21hc29mdA==
Response:
ok
Success
doUpdateBucketsList
1549
smestorage
romasoft
doSetDefaultBucket
Sets default bucket. Default bucket is used when it is not specified where to upload file.
This is used only for S3 or Mosso (RackSpace). For Mosso (RackSpace) bucket means container.
Arguments:
Provider ID.
Bucket name.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSetDefaultBucket/HMT=
Success response parameters:
Default bucket and provider id
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
bucket - bucket name.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doSetDefaultBu
cket&pi_id=1549&buckets=romasoft
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doSetDefaultBucket/MTU0OQ==,cm9tYX
NvZnQ=
Response:
ok
Success
doSetDefaultBucket
1549
doAddBucket
Adds new bucket. Bucket is created in S3 (or container in Mosso). And just created bucket is added to the list
of used buckets.
This is used only for S3 or Mosso. For Mosso bucket means container.
Arguments:
Provider ID.
Bucket name.
Extra information. For Amazon S3 this argument can be 'EU'. In this case bucket will be created in
eurolocation.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doAddBucket/HMT=
Success response parameters:
Status. Error can appear if this bucket already exists.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
bucket - bucket name.
extra - extra information
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doAddBucket&pi
_id=1549&bucket=some_bucket&extra=EU
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doAddBucket/MTU0OQ==,c29tZV9idWNr
ZXQ=,RVU=
Response:
ok
Success
doAddBucket
1549
some_bucket
doChangeProviderPassword
Changes provider account password that is saved in SMEStorage. This function is used when account
password was changed on cloud storage. Example, Gmail account password was changed. And it is needed
to change it in SMEStorage to continue working with the Gmail provider.
Password can be API key. It is related to provider.
Arguments:
Provider ID.
New password.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doChangeProviderPassword/HMT=
Success response parameters:
Status. Error can appear if password is incorrect.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
password - password.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doChangeProvi
derPassword&pi_id=1548&password=qwerty123
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doChangeProviderPassword/MTU0OA==,
cXdlcnR5MTIz
Response:
ok
Success
doChangeProviderPassword
doChangeProviderSettings
Changes provider settings. This function can be used to change provider change like chunksize, set chinking
on/off, sizelimit. In general this function can change any field from provider info.
Arguments:
Provider ID.
Data. Data is string in format
fieldname1=fieldvalue1fieldname2=fieldvalue2....fieldnameN=fieldvalueN .
is return carriage symbol (13 code or “\n” in programming languages)
Example of data:
pi_sizelimit=1000000
pi_chinking=y
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doChangeProviderSettings/HMT=,LKJYK
LJBVJKUGKKYKGFUKUY
Success response parameters:
Status.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
data - data.
getProviderInformation
Returns provider information in details.
Arguments:
Provider ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getProviderInformation/HMT=
Success response parameters:
Function returns detailed provider information.
Argument names to call this function with alternative method (GET or POST)
pi_id - provider ID.
Import/Export functions
getImpExpProviders
Get the list of providers that can be used for export and import. Returns 2 lists.
Arguments:
no arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getImpExpProviders/
Success response parameters:
Returns 2 lists: export and import. The lists of providers types that can be used for export/import
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=getImpExpProvi
ders&
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/getImpExpProviders/
Response:
ok
Success
getImpExpProviders
1
Amazon S3
S3StorageProvider
6
y
1
1
1
s3
n
n
………..
1
Amazon S3
S3StorageProvider
6
y
1
1
1
s3
n
n
………..
doImpExpLogin
This function is used on the first step of import/export. It is needed to check if the access data is correct.
Data provided with the call of this function is similar to data of doAddProvider function. Before the call of
doImpExpLogin getAddProviderMetaFields function must be called to get list of Auth fields required for
chosen provider for Import/Export.
Arguments:
Provider type ID,
Auth data. Special formatted string with auth data.
Format of the auth data string
fieldname1=value1fieldname2=value2…fieldnameN=valueN
These are pairs of fieldname=fieldvalue joined with symbol (usually marked with „\n‟).
Example:
provider_login=mygmaillogin
provider_password=mygmailpassword
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doImpExpLogin/PF=,LJGKKJGYFMHF
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
data - Special formatted string with auth data.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImpExpLogin
&pr_id=Mg==&data=cHJv7mlk5JfbG9naW49a22zdHlya5as4dWhgcgpwbm9haWglclrwfg12aWdf0eXJr22djE
z
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImpExpLogin/Mg==,cHJv7mlk5JfbG9na
W49a22zdHlya5as4dWhgcgpwbm9haWglclrwfg12aWdf0eXJr22djEz
Response:
ok
Success
doImpExpLogin
doExpChoseDest
This function is called as 2nd step of export. It must be called 2 times. The first time is to get the list of export
destination folders. The second time tis o set export destination folder. For some provider types (like Gmail)
the second call of this function can be missed, because the provider supports a flat files structure (no
folders).
Arguments:
Provider type ID,
Step - 0 for first call and 1 for second,
folder - provider folder where files will be exported to (used only for step 1 (second step)).
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doExpChoseDest/PF=,LJGKKJGYFMHF
Success response parameters:
Returns the list of providers folders for step 0 (first step). And success for second step. Also returns option
skip . If this option is 1 then second call (step 1) can be missed. This occurs for providers that has flat files
storage (like Gmail).
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
step - step
folder - folder
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doExpChoseDe
st&pr_id=2&step=0&folder=
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doExpChoseDest/Mg==,MA==,
Response:
ok
Success
doExpChoseDest
0
1
doExpChoseSource
This function is called as the 3rd step of export. This function sets files that will be exported. There needs to
be provided the list of ids for export and type of ids. Type can be: all files, folders and files. If type is all files
then all account's files will be exported. If type is folders then all files from provider folders and their
subfolders will be exported. If type is files then provided files will be exported.
Usually before call of this function it is needed to get the list of files and folders with the function getFilesList.
Arguments:
Provider type ID,
Export ids type - 0 if all files, 1 if folders, 2 if files,
Export ids - in case of 2-nd argument is 0 this argument is ignored. If 1 then this must be comma
separated list of folders' ids. If 2 then this must be comma separated list of files' ids.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doExpChoseSource/PF=,LJGKKJGYFMH
F
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
sourcetype - export source type
sourceids - export source ids
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doExpChoseSo
urce&pr_id=2&sourcetype=1&sourceids=550185
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doExpChoseSource/Mg==,MQ==,NTUwM
Tg1
Response:
ok
Success
doExpChoseSource
doExport
This is used last for completing the export. The function can be called a few times if there are a couple of
files to export. Each call of this function returns an option that is used to check if export is completed. If not
then the function is called again and a special string returned from the previous call must be posted as the
argument.
Arguments:
Provider type ID,
Status data - special string that can be read from previous call of this function. If this is first call
then this argument is empty.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doExport/PF=,LJGKKJGYFMHF
Success response parameters:
Returns export info. Iscompleted defines if export is completed. If 0 then is not completed and node
statusdata must be read and used for next call of this function.
Also returns amount of files and amount of exported files.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
statusdata - status data
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doExport&pr_id
=2&statusdata=
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doExport/Mg==,
Response:
ok
Success
doExport
W2ZhbHNlLDIsMCwiRm9sZGVycyB0cmVlIHJlY3JlYXRlZC4iXQ==
0
0
2
Folders tree recreated.
0
doExportInBackground
This function is called to add and complete the export process in the background.
Arguments:
Provider type ID,
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doExportInBackground/PF=
Success response parameters:
Return s success or not.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doExportInBack
ground&pr_id=2
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doExportInBackground/Mg==
Response:
ok
Success
doExportInBackground
doImpChoseSource
This function is called as the 2nd step of the import. It must be called 2 times. The first time is to get the list
of import source folders. The second time is to set the import source folders. For some provider types (like
Gmail) the second call of this function can be missed, because the provider supports a flat files structure (no
folders).
Arguments:
Provider type ID,
Step - 0 for first call and 1 for second,
folders - comma separated list of provider folders ids from where files will be imported (used only for
step 1 (second step)).
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doImpChoseSource/PF=,LJGKKJGYFMH
F
Success response parameters:
Returns the list of provider folders for step 0 (first step). And success for second step. Also returns option
skip for first call. If this option is 1 then second call (step 1) can be missed. This occurs for providers that
have flat files storage (like Gmail).
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
step - step
folders - folders list (comma separated list of ids)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImpChoseSo
urce&pr_id=2&step=0
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImpChoseSource/Mg==,MA==
Response:
ok
Success
doExpChoseDest
0
1
doImpChoseDest
This function is called as the 3rd step of import. This function sets the folder where imported files will be
saved.
Arguments:
Provider type ID,
Folder ID - id of folder in account
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doImpChoseDest/PF=,LJ
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
folder - folder
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImpChoseDe
st&pr_id=2&folder=550185
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImpChoseDest/Mg==,NTUwMTg1
Response:
ok
Success
doImpChoseDest
doImport
This is used last for completing import. The function can be called a few times if there are a couple of files to
import. Each call of this function returns an option that is used to check if the import is completed. If not then
the function is called again and a special string returned from the previous call must be posted as the
argument.
Arguments:
Provider type ID,
Status data - special string that can be read from previous call of this function. If this is first call
then this argument is empty.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doImport/PF=,LJGKKJGYFMHF
Success response parameters:
Returns import. Option Iscompleted defines if import is completed. If 0 then is not completed and node
statusdata must be read and used for next call of this function.
Also returns amount of files and amount of imported files.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
statusdata - status data
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImport&pr_id=
2&statusdata=
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImport/Mg==,
Response:
ok
Success
doImport
W2ZhbHNlLDAsMCwiUHJlcGFyaW5nIGltcG9ydC4iLDBd
0
0
0
Preparing import.
0
doImportInBackground
This function is called to add the import process in background.
Arguments:
Provider type ID,
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doImportInBackground/PF=
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
pr_id - provider type ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImportInBack
ground&pr_id=2
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImportInBackground/Mg==
Response:
ok
Success
doImportInBackground
Contacts import functions
getImportContactsProviders
Returns the list of providers that can be used to import contacts from. Providers are of 2 types: email and
social. This function should be called when showing the user dialog to import contacts.
Arguments:
No arguments
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=getImportContac
tsProviders
Success response parameters:
2 lists of providers: email and social providers.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=getImportContac
tsProviders&
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/getImportContactsProviders/
Response:
ok
Success
email
Abv
1.0.4
Get the contacts from a Abv account
1.6.5
email
http://www.abv.bg/
abv
…………..
social
Badoo
1.0.2
Get the contacts from a badoo.com account
1.6.7
social
http://www.badoo.com/
badoo
……………….
getImportContactsProviders
getContactsForImport
Returns the list of contacts in the selected provider. This function is used when a user does not want to
import all contacts at one time but wants to choose which contacts to import.
The function returns the list of contacts. For email providers each contact is Name and Email. For social
providers contacts data contains only Name.
Arguments:
Provider – provider to import contacts from (provider ID)
Login - provider account login or email (related to provider)
Password - provider account password
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=getContactsForI
mport&provider=facebook&login=myemail@user.com&password=mypass
Success response parameters:
The list of contacts .
Argument names to call this function with alternative method (GET or POST)
provider - provider id
login - provider account login/email
password - provider account password
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=getContactsForI
mport&provider=gmail2&login=user_login&password=user_pass
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/getContactsForImport/Z21hdgwy,dmlrx32c
1vf4JhbDI=,4vbn654Rf8TIzNDU=
Response:
ok
Success
gmail2
email
GMail
user_login
user_pass
Viki Al
viki.s@gmail.com
getContactsForImport
doImportContacts
This function is used to import contacts to SMEStorage. This function can be called a few times if there are a
lot of contacts to import.
Function returns option “completed” that says if all contacts are imported. If “completed” is 0 then it is needed
to call this function again with a special argument that was returned from the previous call. See details below.
Arguments:
Provider – provider to import contacts from (provider ID)
Login - provider account login or email (related to provider)
Password - provider account password
contacts - comma separated list of contacts that will be imported. For email provider contacts
this list is list of emails. For social contact provider this list is list of names. If this argument is empty then all
contacts from provider are imported.
Tags - comma separated list of tags that will be assigned to imported contacts.
Continueimport - this argument is used to continue import. Value of this argument should be the string
returned from previous call of this function in node “importid”. If this argument is set then all another
arguments will be ignored (so all of them can be set empty)
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doImportContact
s&provider=facebook&login=myemail@user.com&password=mypass
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doImportContact
s&continueimport=UYFRFTHEHTDHGEGHHGE
Success response parameters:
The list of files that are imported contacts . Also some additional info: count of imported contacts, count of
contacts that already exists, count of changed contacts ect.
Argument names to call this function with alternative method (GET or POST)
provider - provider id
login - provider account login/email
password - provider account password
contacts - comma separated list of contacts
tags - tags
continueimport - string that identifies not completed import
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=doImportContact
s&provider=gmail2&login=usr_login&password=usr_pass&contacts=viki.s@gmail.com&tags=&continueimpor
t=error
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/doImportContacts/MTU0OA==,a26ssd654
fsd654fcx321vf5==,as54da5XC4s6da564sdc2DS88f54gasSS==,a29zdHlya28uaWhvckBnbWFpbC5jb20=,,Z
XJyb3I=
Response:
ok
Success
0
0
1
0
doImportContacts
doAddContacts
This function is used to add contacts to SMEStorage.
Arguments:
Contacts list – the list of lines with contacts information. Each line is 1 contact item. Format of
contact items are specified with next argument.
Format of contacts items - if is empty then format is Name:Email . Can be different format. Ex.
Name:email:address:phone. In this case each contact item must be in format
Contactname:contactemail:contactaddress:contactphone
tags - list of tags that must be assigned to each of added contacts.
Master - defines what data are master if contact exists. If is 'y' or nothing then new data are master
and contact item will be overwritten if data are different. If is 'n' then only original data will be added and
existent will be leaved as is.
provider - this is optional string thet will be saved in contact file as provider
fi_pid - this is id of the folder (contacts group) where to add contats.
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doAddContacts
&provider=facebook&login=myemail@user.com&password=mypass
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doImportContact
s&continueimport=UYFRFTHEHTDHGEGHHGE
Success response parameters:
The list of files that are added contacts . Also some additional info: count of added contacts, count of
contacts that already exists, count of changed contacts ect.
Argument names to call this function with alternative method (GET or POST)
contacts - contact items.
Format - format
tags - tags
master - 'y' or 'n'
provider - optional
fi_pid - optional. If is empty then contacts will be added to My contacts folder.
Example of data.
Format is:
name:email:address
Contacts is:
JohnSmitt:john@smitt.com:new-york
SaraSmitt:sara@smitt.com:london
parseContactFile
This function can be used to extract data from a contact file. This function returns an array of fields that are
included in the contact vCard html file.
Arguments:
File ID
Return code – checks if to return html code of the contact file in response.
Codeformat - what format of html should be used if return code. If is set to 'base64' then html code
will be base64 encoded
Type of returned data - values: string, hash or empty. By default data are returned as array of
contact fields. If 'hash' is used then data are returned as hash: fieldname=>fieldvalue. If 'string' then data are
joined to string , data pairs are split with symbol.
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=parseContactFil
e&fi_id=123456
Success response parameters:
The list of contact file list. Returned data format are related to Type of returned data argument
Argument names to call this function with alternative method (GET or POST)
fi_id - fileID
returncode - checks if to return html code ('y' or 'n')
codeformat - format of returned code ('base64' or empty)
returntype - format of returned data list ('string', 'hash' or empty)
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=parseContactFil
e&fi_id=1029058&returncode=n&codeformat=&returntype=string
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/parseContactFile/MTAyOTA1OA==,bg==,,
c3RyaW5n
Response:
ok
Success
field1=value1
parseContactFile
getContactInfo
Returns list of contacts data for given contact files or contact groups. Can return only emails. This function
can be used when sending emails for selected contacts or contact groups, etc.
Arguments:
File ID – list of files or folders Ids (comma separated). Files must be contact files and folders must be contact
groups (folders with structtype 'c')
Just emails ('y' if it is needed to return just emails for contact items)
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=getContactInfo&
fi_id=123456,234567,456789&justemails=y
Success response parameters:
The list of parsed contact files. If second argument is set to 'y' then returns the list of emails.
Argument names to call this function with alternative method (GET or POST)
fi_id - fileIDs list
justemails - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getContactInfo&
fi_id=1029058&justemails=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getContactInfo/MTAyOTA1OA==,bg==
Response:
ok
Success
value1
getContactInfo
changeContactFile
Update contact file with new data.
Arguments:
File ID – id of file that will be updated
New data. Format of this data should be
field1=value1field2=value2...fieldN=valueN . means “\n”
symbol.
3-rd argument is reserved (set it empty)
4-th argument is reserved (set it empty)
Load file. If is set to 'y' then new data will be written over old data and all data that is not in the list to be
updated will be saved. In the other case the contact file will be created from provided data only and all other
fields will be lost. It is recommended to set this value to 'y'.
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=changeContactF
ile&name=Vasia%13email=newemail@vasia.com
Success response parameters:
Success or not
Argument names to call this function with alternative method (GET or POST)
fi_id - file id
data - contact data
loadfile - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=changeContact
File&fi_id=1029058&data=field1=value1&loadfile=
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/changeContactFile/MTAyOTA1OA==,Zmll
bGQxPXZhbHVlMQ==,
Response:
ok
Success
1029058
1029052
4637
()
upl_4afc29b2f0f13.cnt
cnt
0
2009-11-12 15:34:56
71
application/octet-stream
801345f9c0eb3fff99c9f382f0e48e23
……….
changeContactFile
getContactsList
Returns the list of all contacts with groups and subgroups. This function can be used to get data for building
of the contacts tree.
Arguments:
No argumnts
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=getContactsList
Success response parameters:
Array of contacts.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getContactsList
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getContactsList/
Response:
ok
Success
folder75
1029052
1017099
1
2009-11-12 15:05:51
0
1
()
1029058
1029052
0
2009-11-12 15:34:56
1
0
1
getContactsList
doSuggestContacts
Returns the list of contacts and contacts groups filtered with string. This function can be used for contact
auto-suggest tools. Contacts are filtered by string that is in the beginning of contact the title (or group title)
Arguments:
Input string to filter with
Format of returned data – json or empty. If json then data will be in JSON format. In other cases xml format
as for another API functions.
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=doSuggestCont
acts&input=My&rettype=json
Success response parameters:
The list of contact files.
Argument names to call this function with alternative method (GET or POST)
Input - staring to filter
rettype - format of returned data
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=doSuggestCont
acts&Input=val&rettype=
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/doSuggestContacts/dmFs,
Response:
ok
Success
1029052
folder75
Group: folder75
doSuggestContacts
getStandartContactsFields
Returns the list of fields (classes) that are used in SMEStorage vCard microformat files. These data can be
used for editing of vCard microformat files.
Arguments:
No arguments
Example:
http://smestorage.com/api/rpc.php?token=1a3c5b2c5e64d5ecb56df380871594dc&function=getStandartCont
actsFields
Success response parameters:
The list of fields.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getStandartCont
actsFields&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getStandartContactsFields/
Response:
ok
Success
First name
Middle Name
Last name
Full name
Street address
City
Region
Postal code
Country
Organization
Phone
Email
Site
Photo url
AIM
YIM
Jabber
getStandartContactsFields
Organization package functions
getOrganizationStaff
Returns the list of organisation members. Can be called by any Org member.
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getOrganizationStaff/
Success response parameters:
Returns the list of users.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=786044d2744dfa923a501d9cfc9f5ddc&function=getOrganizationS
taff&
Alternate request:
http://smestorage.com/api/786044d2744dfa923a501d9cfc9f5ddc/getOrganizationStaff/
Response:
ok
Success
getOrganizationStaff
3623
User87 Corp. administrator
orgtest
user87@gmail.com
25121982
28
2009-04-27 07:37:53
1
2185455
0000-00-00 00:00:00
0
0
0
0
13e9d704400ecbb8405514403261c683
0
0
……………………………..
{"defaultpage":"favourites","forseorgencrypt":"n","chunkingallowedinorg":"n",
"chunksizeinorg":"40000","chunkingallowed":"y"}
2
18
doCreateOrgMember
This function can be called by an Org admin to add a new Org user. If the adding of a new Org member was
successful then the new user will receive an email with a confirmation link. The password will be generated
randomly and send to the user after activation.
Arguments:
User name,
User Login,
User email,
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doCreateOrgMember/NgtyHDHD,M67Fr4
H,MnbJHFjH=
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
us_name - user name
us_login - user login
us_email - user email
Example.
Request example:
http://smestorage.com/api/rpc.php?token=786044d2744dfa923a501d9cfc9f5ddc&function=doCreateOrgMe
mber&us_name=Test2&us_login=user_log123&us_email=user444@gmail.com
Alternate request:
http://smestorage.com/api/786044d2744dfa923a501d9cfc9f5ddc/doCreateOrgMember/Vmlrax5n,dmlraaxnY
WRtaXJhbA==,dmlraW5n6rtaXJhbbWFpbC5jb20=
Response:
ok
Success
4663
doCreateOrgMember
getOrganizationLogs
This function returns the file activity logs of Org members. This can be only be called by an Org admin.
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getOrganizationLogs/
Success response parameters:
Returns logs
Example.
Request example:
http://smestorage.com/api/rpc.php?token=786044d2744dfa923a501d9cfc9f5ddc&function=getOrganizationL
ogs&
Alternate request:
http://smestorage.com/api/786044d2744dfa923a501d9cfc9f5ddc/getOrganizationLogs/
Response:
ok
Success
2
3623
Folder suborggroup created
folders
3623
2009-11-05 06:04:48
3623
Folder orggroup2 created
folders
3623
2009-11-05 03:03:43
getOrganizationLogs
getMyInfo
Returns a user's inforomation
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getMyInfo/
Success response parameters:
Returns user's info.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getMyInfo&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getMyInfo/
Response:
ok
Success
4637
u_name
u_login
user_87@gmail.com
2009-11-11 11:52:01
83
0
2009-11-12 14:58:24
193.239.129.204
n
n
n
n
12
FREE SMEStorage S3+GMail
THis package gives you 250MB free on Amazon S3 and also the ability to use your GMail
as storage. You will see all your files in one "virtual file system"
262144000
0
getMyInfo
Messaging
doSendInternalMessage
Sends internal message to another SMEStorage user. Single users can send to another single user.
Organization members can send to a user or to all Org users.
Arguments:
User login (for Org members login is user@orglogin)
message - message text
orgmessage - 'y' if this message for all Org users. For single users this option must be 'n'
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSendInternalMessage/NgtyHDHD,M67
Fr4H,MnbJHFjH=
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
us_login - user login
message - message
orgmessage - 'y' or 'n'. 'y' if message should be sent to all Org members.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=doSendInternal
Message&us_login=u_login&message=Text_some_message&orgmessage=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/doSendInternalMessage/dmlraW5nYWRt
aXJhbA==,dmlraW5nYWRtaXJhbA==,bg==
Response:
ok
Success
doSendInternalMessage
getInternalMessagesForUser
Returns the list of all messages for users (including read and unread).
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getInternalMessagesForUser/
Success response parameters:
Returns list of messages
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getInternalMess
agesForUser&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getInternalMessagesForUser/
Response:
ok
Success
getInternalMessagesForUser
198
4637
4637
0
2009-11-12 16:06:57
0
0
u_login2
u_name2
193
You are invited to group group5a464c6
Invitation code is 3583eb83d8aff2653760e60041984ec9
You can go to Filenamager on the site to accept invitation. Or you can use your client tool if it allows
acceptance of invtation.
4637
0
0
2009-11-11 12:00:04
0
0
System
…………..
getSentInternalMessages
Returns the list of all messages sent by the user to other users
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getSentInternalMessages/
Success response parameters:
Returns list of messages
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getSentInternal
Messages&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getSentInternalMessages/
Response:
ok
Success
getSentInternalMessages
198
4637
4637
0
2009-11-12 16:06:57
0
u_login
u_name
doMarkInternalMessageAsRead
Sets unread message as read.
Arguments:
Message ID
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doMarkInternalMessageAsRead/Ng=
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
me_id - message ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=doMarkInternal
MessageAsRead&me_id=198
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/doMarkInternalMessageAsRead/MTk4
Response:
ok
Success
doMarkInternalMessageAsRead
doSetMessageRead
Sets unread message as read. This function is similar to the previous function but it also returns next unread
message.
Arguments:
Message ID
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doMarkInternalMessageAsRead/Ng=
Success response parameters:
Returns another unread message (if there is)
Argument names to call this function with alternative method (GET or POST)
me_id - message ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=doSetMessage
Read&me_id=198
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/doSetMessageRead/MTk4
Response:
ok
Success
doSetMessageRead
193
You are invited to group group5a464c6
Invitation code is 3583eb83d8aff2653760e60041984ec9
You can go to Filenamager on the site to accept invitation. Or you can use your client tool if it allows
acceptance of invtation.
4637
0
0
2009-11-11 12:00:04
0
SYSTEM
y
doSetMessageRead
Clipboard functions
getClipboardFiles
Returns the list of files that are in the cloud clipboard. This can be of more than one cloud depending on the
user package.
Arguments:
Option that defines how to return the data. If this option is 'y' then only file Ids will be returned. If 'n' then full
files data will be returned. Default is 'n' .
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getClipboardFiles/
Success response parameters:
Returns the list of files (or file IDs)
Argument names to call this function with alternative method (GET or POST)
returnonlyids - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getClipboardFile
s&returnonlyids=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getClipboardFiles/bg==
Response:
ok
Success
1017126
0
4637
t3.jpg
upl_4afabf1125e4d.jpg
jpg
0
2009-11-11 13:41:44
12
image/jpeg
c1a267880c83420384666b5ad36e6e25
1
0
0
0
g
…………
1
getClipboardFiles
addFilesToClipboard
Add file(s) to clipboard.
Arguments:
File ID or comma separated list of file Ids.
Option that defines how to return the data. If this option is 'y' then only file Ids will be returned. If 'n' then full
files data will be returned. Default is 'n' .
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/addFilesToClipboard/ui7=
Success response parameters:
Returns the list of clipboard files (or file IDs)
Argument names to call this function with alternative method (GET or POST)
fi_id - File ID or comma separated list of file Ids.
returnonlyids - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=addFilesToClipb
oard&fi_id=1017126&returnonlyids=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/addFilesToClipboard/MTAxNzEyNg==,bg
==
Response:
ok
Success
1017126
0
4637
t3.jpg
upl_4afabf1125e4d.jpg
jpg
0
2009-11-11 13:41:44
12
image/jpeg
c1a267880c83420384666b5ad36e6e25
1
0
0
0
g
……….
1
addFilesToClipboard
removeFilesFromClipboard
Remove file(s) from clipboard.
Arguments:
File ID or comma separated list of file Ids.
Option that defines how to return the data. If this option is 'y' then only file Ids will be returned. If 'n' then full
files data will be returned. Default is 'n' .
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/removeFilesFromClipboard/ui7=
Success response parameters:
Returns the list of clipboard files (or file IDs)
Argument names to call this function with alternative method (GET or POST)
fi_id - File ID or comma separated list of file Ids.
returnonlyids - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=removeFilesFro
mClipboard&fi_id=1017127&returnonlyids=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/removeFilesFromClipboard/MTAxNzEyNw
==,bg==
Response:
ok
Success
0
removeFilesFromClipboard
doClearClipboard
Remove all files from clipboard
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doClearClipboard/
Success response parameters:
Returns status
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=doClearClipboar
d&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/doClearClipboard/
Response:
ok
Success
doClearClipboard
addFolderToClipboard
Adds all files from folder to clipboard. Also files from subfolders can be added.
Arguments:
Folder ID
If to include subfolders . 'y' or 'n'
Option that defines how to return the data. If this option is 'y' then only file Ids will be returned. If 'n' then full
files data will be returned. Default is 'n' .
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/addFolderToClipboard/ui7=
Success response parameters:
Returns the list of clipboard files (or file IDs)
Argument names to call this function with alternative method (GET or POST)
fi_id - File ID or comma separated list of file Ids.
Includesubfolders - If to include subfolders . 'y' or 'n'
returnonlyids - 'y' or 'n'
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=addFolderToClip
board&fi_id=1029052&Includesubfolders=y&returnonlyids=n
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/addFolderToClipboard/MTAyOTA1Mg==,e
Q==,bg==
Response:
ok
Success
1029058
1029052
4637
()
upl_4afc29b2f0f13.cnt
cnt
0
2009-11-12 15:34:56
71
application/octet-stream
801345f9c0eb3fff99c9f382f0e48e23
0
0
0
0
c
……………
1
addFolderToClipboard
Other functions
getSpaceInfo
Returns info about used space for all providers.
Arguments:
no arguments
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getSpaceInfo/
Success response parameters:
Returns list of providers and info about used space. And total used space info for account.
doSendFileLinkToTwitter
This function sends a file link (short tinyurl) with message to Twitter status time line.
Arguments:
File ID,
Text message
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/doSendFileLinkToTwitter/PF=,KJFGJKHK
JGKJ
Success response parameters:
Returns success or not.
Argument names to call this function with alternative method (GET or POST)
fi_id - file ID.
message - message text
Example.
Request example:
http://smestorage.com/api/rpc.php?token=f6a6bcdb2168353e2ebf11994b5d9693&function=doSendFileLinkT
oTwitter&fi_id=1017126&message=Some_message
Alternate request:
http://smestorage.com/api/f6a6bcdb2168353e2ebf11994b5d9693/doSendFileLinkToTwitter/MTAxNzEyNg==,
U29tZV9tZXNzYWdl
Response:
ok
Success
doSendFileLinkToTwitter
getFileTinyURL
This function returns a short url of the file (from tinyurl.com)
Arguments:
File ID
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getFileTinyURL/PF=
Success response parameters:
Returns file tinyurl.
Argument names to call this function with alternative method (GET or POST)
fi_id - file ID.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getFileTinyURL
&fi_id=1017126
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getFileTinyURL/MTAxNzEyNg==
Response:
ok
Success
getFileTinyURL
http://smestorage.com/files/c1a267880c83420384666b5ad36e6e25.jpg
http://tinyurl.com/ydugw5j
getSchedulerTypesForUser
This function returns the list of allowed scheduler types for user. Each type is described with code,title and
the description of the required data.
Example. The Scheduler type for synchronization of the provider has code 's' , title 'Provider sync' and
requires provider ID for adding the task.
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getSchedulerTypesForUser/
Success response parameters:
Returns the list of types.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getSchedulerTy
pesForUser&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getSchedulerTypesForUser/
Response:
ok
Success
Provider resync
Provider
Provider ID
getSchedulerTypesForUser
getUserSchedulerTasks
Returns the list of a user's scheduler tasks.
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getUserSchedulerTasks/
Success response parameters:
Returns the list of tasks.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=getUserSchedul
erTasks&
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/getUserSchedulerTasks/
Response:
ok
Success
75
4637
s
data
d
22
0000-00-00 00:00:00
:
22:00
Provider resync
getUserSchedulerTasks
addUserSchedulerTask
Adds new scheduler task.
Arguments:
Task type. Example – 's' . See function getSchedulerTypesForUser.
Execution period – d -day or w - week (one letter should be set). If d then task will be executed each day, if
w then once a week.
Execution time. If previous argument is d then this value should be number from 00:00 to 23:00 (hour of
execution). If previous argument is w then this value should be number from 1 to 7. 1 means Monday
and 7 Sunday.
Task data. This is related to task type. For type s (Provider sync) this value is provider ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/addUserSchedulerTask/NB=,Jh=,Ht=,yT=
Success response parameters:
Returns just added task..
Argument names to call this function with alternative method (GET or POST)
sc_type - Task type
sc_period - Execution period
sc_time - Execution time
sc_data - Task data
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=addUserSchedu
lerTask&sc_type=s&sc_period=d&sc_time=22:00&sc_data=data
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/addUserSchedulerTask/cw==,ZA==,MjI6
MDA=,ZGF0YQ==
Response:
ok
Success
75
4637
s
data
d
22
0000-00-00 00:00:00
:
22:00
Provider resync
addUserSchedulerTask
deleteUserSchedulerTask
Deletes scheduler task.
Arguments:
Task ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/deleteUserSchedulerTask/NB=
Success response parameters:
Returns status.
Argument names to call this function with alternative method (GET or POST)
sc_id - Task ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=6b252f827c058846c3b6890185db97a2&function=deleteUserSche
dulerTask&sc_id=74
Alternate request:
http://smestorage.com/api/6b252f827c058846c3b6890185db97a2/deleteUserSchedulerTask/NzU=
Response:
ok
Success
deleteUserSchedulerTask
getUserBackgroundTasks
Returns the list of A user's background tasks of all statuses (running, completed, waiting).
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/getUserBackgroundTasks/
Success response parameters:
Returns the list of background tasks.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=getUserBackgro
undTasks&
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/getUserBackgroundTasks/
Response:
ok
Success
460
3623
export
2
usr_log
usr_pass
1
1
550185
provider_login=usr_log
provider_password=usr_pass
Exported 2 files from 2
W3RydWUsMiwyLCJFeHBvcnRpbmcgZmlsZXMiXQ==
Completed
100
2009-11-16 05:31:13
c
2009-11-16 05:32:30
Export
Completed
Export. Gmail (usr_log)
getUserBackgroundTasks
deleteBackgroundTask
Deletes background task. Only a completed task can be deleted.
Arguments:
Task ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/deleteBackgroundTask/NB=
Success response parameters:
Returns status.
Argument names to call this function with alternative method (GET or POST)
bt_id - Background task ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=deleteBackgrou
ndTask&bt_id=460
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/deleteBackgroundTask/NDYw
Response:
ok
Success
deleteBackgroundTask
deleteAllBackgroundTasks
Deletes all completed background tasks
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/deleteAllBackgroundTasks/NB=
Success response parameters:
Returns status.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=deleteAllBackgr
oundTasks&
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/deleteAllBackgroundTasks/
Response:
ok
Success
deleteAllBackgroundTasks
cancelBackgroundTask
Cancel background task. Only a task not yet started can be cancelled (status is 'waiting').
Arguments:
Task ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/cancelBackgroundTask/NB=
Success response parameters:
Returns status.
Argument names to call this function with alternative method (GET or POST)
bt_id - Background task ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=cancelBackgrou
ndTask&bt_id=460
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/cancelBackgroundTask/NDYw
Response:
ok
Success
cancelBackgroundTask
cancelAllBackgroundTasks
Cancels all waiting background tasks
Arguments:
no
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/cancelAllBackgroundTasks/NB=
Success response parameters:
Returns status.
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=cancelAllBackgr
oundTasks&bt_id=460
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/cancelAllBackgroundTasks/NDYw
Response:
ok
Success
cancelAllBackgroundTasks
restartBackgroundTask
Restart completed background task.
Arguments:
Task ID.
Example:
http://smestorage.com/api/1a3c5b2c5e64d5ecb56df380871594dc/restartBackgroundTask/NB=
Success response parameters:
Returns status.
Argument names to call this function with alternative method (GET or POST)
bt_id - Background task ID
Example.
Request example:
http://smestorage.com/api/rpc.php?token=68cbe446583d8a4b8c55e1a3c0f616c9&function=restartBackgrou
ndTask&bt_id=460
Alternate request:
http://smestorage.com/api/68cbe446583d8a4b8c55e1a3c0f616c9/restartBackgroundTask/NDYw
Response:
ok
Success
restartBackgroundTask
Combined procedures
Registration of new user
When calling rthe egistration functions, a token is not needed and must be set to „*‟ for all these functions.
To process registration:
1. Call the function getRegistrationForm to get the registration information and captcha image with
session id. This function returns captcha image base64 encoded. So you need to decode it and
show for user (it is ja peg file).
2. Call the function doRegistration to send the ser data and captcha code. The Captcha session id from
previous calling must be send here too.
3. The User must then check his email box to see the activation code in the email message. Then it is
needed to call the function doActivation to send the ctivation code. If the user chooses a package
that is not free then the url for paying will be returned. The user must to be redirected with this url to
pay.
4. If the user didn‟t get the message with the activation code then function doResendActivation can be
used to resend activation message and also to change the email address.
External logging on
When a user uses an external provider to store files and did not save his login info then he must provide this
information when logging in with the API.
In the response of the function getToken there can be a notice key in returned data. Usually this key doesn't
exist.
Usually getToken response is:
ok
Success
7bee63c6d1b4bbec40efe4a62226fc89
When user has no external login info saved then response will be:
ok
Notice. You must to provide your provider access data to
continue the work.
52af4f8f71fe3c1b5c8093cd3f4c2a81
1
Option notice value is 1. It means the user must provide login and password (API keys for some providers)
for provider and function setProviderData must be called. If this calling is successful then the user can start
to work with SMEStorage.
Working with providers
Adding a cloud provider
Adding of a cloud provider is processed in a few steps.
1. Call function getAddProviderMetaFields for chosen provider type to get the list required fields to init
this provider.
2. Call function doAddProvider with step 0. Format data as described in function doAddProvider
description. Usually it is needed to post 2 fields: account login and password. In some cases it is
needed to post more fields;
3. Read response of first calling of function doAddProvider. There will be next step number;
4. If next step is 1 then parse buckets list and enable the user to choose buckets and default bucket.
Else go to 6;
5. Call function doAddProvider with step 1 and buckets data;
6. If next step is 2 then enable user to choose if he wants to save his account login data. Else go to 8;
7. Call function doAddProvider with step 2 and his selection if to save account login data;
8. Call function doAddProvider with step 3 to init provider;
9. Do provider sync (see Resynchronising of provider) to get files info into SMEStorage.
Resynchronising of cloud provider
To resync files information it is is needed to use the function doProviderSync.
This function can be called more then 1 time if there are a couple of files.
Instructions:
1. Call function doProviderSync with provider id. Second argument should be empty;
2. Read amount of processed files, the lists of new, deleted and updated files and show this for the
user;
3. Read statusdata and iscompleted nodes from response;
4. if iscompleted value is 1 then go to 7;
5. Call function doProviderSync with provider id and second argument is statusdata received from
previous step;
6. Go to 2;
7. This is all.
If provider has just been just added then all files will be in the new files list.
Managing buckets
This feature is used for S3 and Mosso (RackSpace) providers only.
Use functions getProviderBuckets, doUpdateBucketsList, doSetDefaultBucket, doAddBucket to manage
buckets list.
Other cloud provider options
Change default provider. Function doSetDefaultProvider .
Change password for provider account. Function doChangeProviderPassword .
Set the provider to be the golden data source for sync. Function doSetMasterCopy .
Faxing
To fax files there is a function called doFaxDocuments.
Sometimes it is needed to add documents to a temporary list before faxing them (if you wish to fax more than
one document). To do this use the functions doAddToMyFaxes (to add or delete file to or from the list) and
getFaxesList (to get the list).
Uploading
This procedure is processed in 4 steps.
1. Init uploading. Receive uploading code.
2. Upload file to special Url where uploading code is included.
3. (optional) Check uploading status while uploading. Uploading code is used to identify process.
4. Complete uploading. Uploading code is used to identify process.
In the step 2 the file is posted with the http POST method to sa pecial URL that is different from URLs of this
API.
Currently uploading URL is:
http://www.smetube.com/cgi-bin/uploader/uploader1.cgi?UPLOADINGCODE
Where UPLOADINGCODE was returned by API function doInitUpload in the step 1.
Uploader can receive additional arguments.
uploader1.cgi?UPLOADINGCODE,FILESIZE,STARTBYTE
Only UPLOADINGCODE is required. 2 Another arguments can be missed.
FILESIZE – the size of file that is being uploaded. It is used if it is not possible to post form only with 1 input
field (see below).
STARTBYTE – is used when continue stopped file uploading (uploading resume)
If it is needed to set STARTBYTE but FILESIZE is not needed to set, then FILESIZE should be set to 0.
Example: uploader1.cgi?UPLOADINGCODE,0,123456
IMPORTANT NOTE. Http request that is used to post file CAN‟T contain any other data instead of 1 file.
In HTML presentation form for posting the file looks like:
There is only 1 input field. The name of the field can be anything.
Uploading procedure steps in details.
1. Use function doInitUpload to post the file name, file description, tags and other file data and
receive the uploading code. With parameter responsetype you can set how you will receive
response from the uploading script in step 2. You can have result as XML or JSON and data
has the same structure similar to other functions in this API.
Also you can set the response typeto be javascript and response data some javascript code.
Uploading script will return html where this code will be included. This response type can be
used when uploading is processed in the browser.
2. Emulate POST request with action URL http://www.smetube.com/cgi-
bin/uploader/uploader1.cgi?UPLOADINGCODE where UPLOADINGCODE was received
from step 1.
3. Check uploading progress while uploading is underway. This must be done in pa arallel
process, because the main process is uploading the file at this time. You can check progress
to draw a graphical progress bar or something similar to this
4. Complete uploading with function doCompleteUpload. This function checks if a file was
successfully uploaded and does data synchronization to make the file accessible.
Backup of emails
Backup is processed in 3 steps.
1. Get amount of emails with function getAmountOfEmails
2. Backup each email with function doBackupEmail
3. Compress all emails in 1 zip file with function doZipBackupedEmailBox
Call getAmountOfEmails and remember returned values: amount of email and unique string.
Call doBackupEmail with email number 1 and unique code received before. Leave folder id empty. Remebre
returned folder id.
Call doBackupEmail for emails from 2 to value received in step 1. Use folder id received before.
Call doZipBackupedEmailBox to complete backuping with values received before.
Encrypting of files
Files are encrypted using AES 256 bit file encyryption algorithm. To make a file that is stored, encrypted, set
the encryption phrase argument for fthe unction doInitUpload.
If the encryption phrase is missed then it will be impossible to decrypt the file. Note that SMEStorage does
not store the encryption phrase
To download encrypted file it is needed to set an additional argument – phrase in function getFile.
Before getting the file it is recommended to call function doCheckEncryptionPhrase to verify the encryption
phrase is correct.
To check if the file is encrypted see fi_encrypted field of file record (if it is 1 then it is encrypted).
Filtering the content
When there are a lot of files in a users account it can provide problems when loading the list. In this case it is
recommended to user filtering.
By default there is no filter on a users files.
Filter can be set/changed with the function doSetFilesFilter and unset with function doDeleteFilesFilter.
If it is needed to check if filter is set then the function getFilesFilter can be used. Also functions getFilesList
and getAllForUser returns filter state in their responses.
If the filter is not set and there are to many files in the account then files list is not returned when function
getFilesList or getAllForUser are called with additional argument (see descriptions of these functions).
It is possible to define structure types for filter. So filter can affect only for files for selected structures. All
another structures will be returned completely full. If structure types is not defined then filter works for all
structures.
Recommendation.
When all files must be returned with single calling of getFilesList without specifying a folder then it is
recommended to pass additional (2-nd) argument for this function. In this case the list of files will not be
returned if there are a lot of files.
When data are returned it is needed to check :
if amount of returned files is 0
total amount of files is more then 0 (in returned stats node)
if filter is not set
If all 3 decisions are correct then it is time to ask a user to specify a ilter for his files.
Examples.
There are 2 possible ways to init filtering on load.
1. If your application loads all files at 1 time .
2. If your application loads files by folders (root folder on login and later folders that
user want to open).
1. If your application loads all files at 1 time. In this case function getFilesList is loaded without folder id
argument.
Call function getFilesList with second argument value 1.
Ex. http://smestorage.com/api/8e58f8d14cc1772ce5af73da718c53ea/getFilesList/ ,MQ==
Response will be:
ok
Success
getFilesList
269
88
88
269
getFilesFilter
0
1
1
357
...............
In response take a look at the filterinfo branch. There is node isfilter . If this value is 1 then filter was used for
the list. If this value is 0 then filter is not set.
If filterinfo-> tomachfiles is 1 and filterinfo->isfilter is 0 then it is time to ask user to set filter. In this
case filelist will be empty and length will be 0.
If a user doesn‟t want to set filter and is ready to work with a long file list then call function getFilesList with
second argument value 0 or miss second argument.
If a user agrees to set a filter then ask him for fthe ilter data and call function doSetFilesFilter and then call
function getFilesList again (second argument can has any value)
Second argument in function getFilesList defines if to return files list when files are not filtered and there are
too many files. If second argument is 1 the files will not be returned for long not filtered list of files.
2. If your application loads files by folders.
In this case before calling getFilesList first time it is recommended to call function getFilesFilter to receive
info about previous filter, if it was set and some usefull data for filtering.
getFilesFilter has no arguments.
Ex. http://smestorage.com/api/8e58f8d14cc1772ce5af73da718c53ea/getFilesFilter/
ok
Success
getFilesFilter
1
26
f
a
A
0
1
This function must be called after user logon to API. If filter is not set (isfilter is 0 ) and tomachfiles is 1 then
user must be asked for filter.
Then filter can be set with function doSetFilesFilter. And after this function getFilesList can be called.
If user want to change filter or set filter during the work then ask user for filter data and call function
doSetFilesFilter .
Also filter can be deleted with function doDeleteFilesFilter.
Structures
It is possible to split files tree for structures. By default there are 2 structures: General and My backups
(email backups). Also at current time it is possible to have additional structure My Syncs (is created and
managed with Sync Centre Tool).
Each file/folder is related to only one structure.
There is fi_structtype field in file/folder record that defines what structure file/folder is related to.
To create new structure just create new folder in root with your fi_structtype code.
Codes g,e,c and s are reserved. Use any other letter.
g – general structure (default value)
e – email backups structure
s – My Syncs structure
c – Contact files
It is recommended to define structure type each time when you create folder or upload file (see descriptions
of procedures for creating folder or uploading file).
If structure type is not defined then it is copied from parent folder of new file/folder.
Import/Export
SMEStorage allows import/export of files from/to external clouds.
Storage providers (called provider types) can support cloud import/export. These are Amazon S3,
RackSpace Clouds, Gmail, FTP server, Box.net, AnyEmail server, Evernote, MobileMe, Google Docs,
SkyDrive and any WebDav cloud. This list will continue to be extended.
Import and export are provided in a few steps.
Import
1. Get list of supported providers for import provider types with function getImpExpProviders
2. Allow the user to choose theprovider required to import files from.
3. Call function getAddProviderMetaFields to get Auth meta data required for this provider type.
4. Prompt user to provide required Auth data and post them with function doImpExpLogin
5. Continue If login is successfull
6. Call function doImpChoseSource first time to get list of storage folders
7. If provider supports folders (see description of doImpChoseSource function) ask user to chose
source folders(1 or more). If provider has flat files storage then go to step 9
8. Call function doImpChoseSource second time to set source folders
9. Ask a user to choose the import destination folder (chose folder from existent account folders).
10. Call function doImpChoseDest to set import destination folder
11. If you want to show the user the import process Call function doImport with second argument empty.
Else go to step 16.
12. Show the user the import process. Use returned data: total count of files, count of imported files.
13. If import is completed (see description of doImport function) then go step 15
14. Call function doImport with second argument set with data that was get from pervious call of this
function (see description of doImport function) . Go step 12.
15. Go to step 17.
16. Call function doImportInBackground to add import task to background.
17. You are done.
Export
1. Get list of supported providers or export provider types with function getImpExpProviders
2. Allow user to choose the provider he wants to export files to.
3. Call function getAddProviderMetaFields to get Auth meta data required for this provider type.
4. Prompt user to provide required Auth data and post them with function doImpExpLogin
5. Continue If login is successfull
6. Call function doExpChoseDest first time to get the list of storage folders
7. If provider supports folders (see description of doExpChoseDest function) ask user to chose export
destination folder. If provider has flat files storage then go to step 9
8. Call function doExpChoseDest second time to set destination folder.
9. Ask user to choose export source files. It is possible to export All files, Selected folders or Selected
files.
10. Call function doExpChoseSource to set export source files.
11. If you want to show the user ethe xport process then Call function doExport with second argument
empty. Else go to step 16.
12. Show the user the export process. Use returned data: total count of files, count of exported files.
13. If export is completed (see description of doExport function) then go step 15
14. Call function doExport with second argument set with data that was get from pervious call of this
function (see description of doExport function) . Go step 12.
15. Go to step 17
18. Call function doExportInBackground to add export task to background.
16. You are done
Organisation packages
SMEStorage packages are of 2 types – single user and Organisation.
The Organisation package is specifically for small businesses.
When a user registers and selects as package one of the Org packages then this user becames Org admin.
The Org admin can add users to the Organisation.
To check if a user is Org member use getMyInfo function.
If option us_isorg is 0 then the user is single user.
If option us_isorg is 2 then the user is org admin.
If option us_isorg is 1 then the user is Org member.
Org members have login like userlogin@orglogin . Orglogin is login of Org admin and this is Org domain
olso.
Scheduler tasks and background tasks
Scheduler executes tasks with a specified interval.
Background task is a process that usually takes time and does not require user's browser is opened while
the task is being executed.
To works with scheduler see functions getSchedulerTypesForUser, getUserSchedulerTasks,
addUserSchedulerTask, deleteUserSchedulerTask.
To work with background tasks see functions getUserBackgroundTasks, deleteBackgroundTask,
deleteAllBackgroundTasks, cancelBackgroundTask, cancelAllBackgroundTasks, restartBackgroundTask.
To add background tasks see specified section of the manual (Working with providers, backuping emails,
import/export).
Favourite files
Each file will have a mark if it is a favourite. It is field fi_favorite in files table. If this field value is 1 then file is
marked as favourite.
To get list of all of a user‟s favourite files use getMyFavouriteFiles function.
To set/unset file as favourite use function doFavouriteFile.
Using external editors for files
SMEStorage client applications can use editors for editing and updating files. There are a few file formats
that can be edited: Word doc, Excel xls, Images, Plain text files (txt and any source code files like php, c ect).
Some of type of files can be edited with external tools like ZOHO or Piknic. Another type like plain text, html
or contact files can be edited with SMEStorage original editors.
Editors that are used in the current SMEStorage service.
Editor Provider Used for file types
ZOHO word document editor writer.zoho.com doc
ZOHO spreadsheet editor sheet.zoho.com xls
Picnik images editor www.picnik.com gif,png,jpg
HTML editor SMEStorage.com htm,html
Source editor SMEStorage.com Txt,htm, php, c, cpp, h, pas … (any
plain text file)
Contact editor SMEStorage.com Html (vCard microformat file)
To edit a file the client application must open a special link in the browser window.
Building of links
In each link there are templates:
BASE - it is link to SMEStorage site. Currently it is http://smestorage.com (can be
changed in the future)
AUTOLOGINCODE - it is code that is used to auth the user. This code can be get with function
gettoken when login to API.
FILEID - SMEStorage file ID
FILECODE - file unique code (fi_maincode in files table).
FILEEXT - file extension
Xls and doc files:
BASE/index.php?p=zoho&action=opendocument&id=FILEID&autologin=AUTOLOGINCODE
jpg, gif, png file:
BASE/uploadimage/FILEID/picnik/FILEEXT?autologin=AUTOLOGINCODE
htm files (to edit as HTML document):
BASE/index.php?p=wysiwyg&fi_id=FILEID&type=empty2&editor=&autologin=AUTOLOGINCODE
Source files (txt,php, htm, html ect):
BASE/index.php?p=wysiwyg&fi_id=FILEID&type=empty2&editor=editarea&autologin=AUTOLOGINCODE
Contact files (htm extension):
BASE/index.php??p=contact&fi_id=FILEID&type=empty2&autologin=AUTOLOGINCODE
NOTE. Contact files have htm extension . To differetiate contact files from other HTML files use field fi_struct
type from files table. Contact files have this field value set up to 'c' (see Structures section in this manual).
Uploading resume
Uploading resume is allowed in selected packages.
To know if resume is allowed check the response of the function doInitUpload. There is a node in the
response – 'resumeallowed'. If the value of this node is 'y' then resume is allowed.
There is full resume (to continue from last uploaded byte) and chunk resume (to complete uploading from the
end of last saved chunk).
Uploading can be resumed after it is paused.
To pause uploading means to close socket that is used for uploading. Uploading can be paused by user. In
this case the application must close the socket programmatically. Or uploading can be paused with error. In
this case the application must atch the error and allow for the user to continue uploading (or auto continue).
There can be different situations that raise an error. Most of them are TCP connection lost. Another can be
cached with checking of HTTP response code. If code is not 200 (Success) then this is error and uploading
must be resumed.
To start uploading resume after error (or user action) it is needed to call the function getUploadStatusOnFail .
This function will return count of saved bytes (let call this value as SAVEDBYTES).
Uploading resume is the request similar to simple uploading but file is truncated from the start. It is needed to
drop first part of the file. The count of dropped bytes should be the same as the value returned by function
getUploadStatusOnFail (SAVEDBYTES).
Another difference of the resume is the request query string.
Usually the POST url is
http://www.smetube.com/cgi-bin/uploader/uploader1.cgi?UPLOADINGCODE
For the resume it will be
http://www.smetube.com/cgi-bin/uploader/uploader1.cgi?UPLOADINGCODE,0,SAVEDBYTES
Where UPLOADINGCODE was returned by API function doInitUpload when init uploading.
Code Examples
Example of Upload Resume with Perl.
The first part of the script is removed. There are general instructions and API cals to get token, init uploading.
Some variables are inited in that part of the script.
$filename – contains file screenname
$sourcefile – contains file source path
$uploadcode – contains uploading code returned with API function doInitUpload
#----------------------------------- the code starts here -----------------
my $startbyte=0; #this variable contains file byte position to start uploading.
# for the first uploading it is 0 (this is simple uploading)
&Post1(); #call function to upload file. Uploading should be paused on this call
sleep(5); #wait for 5 seconds. It is emulation of the pause before uploadin resume.
#execute function getUploadStatusOnFail to get status of uploading.
$r=&SMEStorage::execcommand('getUploadStatusOnFail',{'uploadcode'=>$uploadcode});
$startbyte=${$$r{'response'}}{'lastsavedbyte'}; #get count of saved bytes.
#file bytes numeration starts from 0 , so this valu is position of next byte to read for uploading.
&Post1(); # call uploadinf function again. Now paused uploading will be continued.
################ this is function that process uploading. ###################
sub Post1{
#this function uploads the file
#input data are taken from global variables
#the function works in 2 modes: uploading and uploading resume
#the mode depends from variable $startbyte
#if $startbyte is 0 then this is simple uploading
my $socket = new IO::Socket::INET( #open socket to the server
PeerAddr => "thesmespace.com", #this is development server
PeerPort => 80, #standart http port
Proto => 'tcp');
$socket or die "no socket :$!";
#create boundary for multypart form
my $boundry="---------------------------624433355719741605845657464";
#create header of POSt resuest body
my $header="--$boundry\r\n";
$header.="Content-Disposition: form-data; name=\"uploadedfile\";”;
$header.=" filename=\"$filename\"\r\n";
$header.="Content-Type: image/jpeg\r\n";
$header.="\r\n";
#create footer of POSt request body
my $footer="\r\n--$boundry--\r\n";
#calculate content length
#content length is file size + size of header and footer
my $content_length=(-s $sourcefile)+length($header)+length($footer);
if($startbyte>0){
$content_length-=$startbyte;
#if this is resume then decrease content length for already uploaded bytes
}
my $query;
#set up query string
my $qs=$uploadcode;
if($startbyte>0){
#if this is resume of uploading then query string must be extended
$qs.=',0,'.$startbyte;
}
#prepare http request
$query = "POST /cgi-bin/uploader/uploader1.cgi?$qs HTTP/1.1\r\n";
$query.="Host: www.thesmespace.com\r\n";
$query.="Content-Type: multipart/form-data; boundary=$boundry\r\n";
$query.="User-Agent: httpclient\r\n";
$query.="Content-Length: $content_length\r\n";
$query.="\r\n";
#print request to the server
print $socket $query;
#print body header
print $socket $header;
#open source file for writing
open FF ,"0){
#if this is resume then move file pointer to first byte that will be read
seek FF, $startbyte, 0;
}
my $buffer; #this is data buffer
my $posted=0; #this is variable to calculate amount of posted bytes
#it is used to pause uploading in this example
while(!eof(FF)){
read FF,$buffer,1024; #read source file
print $socket $buffer; #post data to the server
$posted+=length($buffer); #calculate count of sent bytes
if($posted>8000 && $startbyte==0){
#if this is not resume. And 8000 bytes are already sent then break uploading
#this will means that uploading is stopped
close FF;
return;
}
}
#close source file
close FF;
#after file body is sent , then post body footer
print $socket $footer;
#read server response
my $r = '';
while () {
$r .= $_;
}
close $socket;
print $r;
}