Difference between revisions of "SOAP API"

From 4shared wiki
Jump to: navigation, search
(New page: 4Shared are happy to present SOAP API description --- == checkSharedDirAccess == public int checkSharedDirAccess(java.lang.String login, java.lang.String ...)
 
Line 4: Line 4:
 
== checkSharedDirAccess ==
 
== checkSharedDirAccess ==
  
public int checkSharedDirAccess(java.lang.String login,
+
  public int checkSharedDirAccess(java.lang.String login,
 
                                 java.lang.String password,
 
                                 java.lang.String password,
 
                                 long dirID,
 
                                 long dirID,
Line 31: Line 31:
 
== checkSubdomain ==
 
== checkSubdomain ==
  
public java.lang.String checkSubdomain(java.lang.String login,
+
  public java.lang.String checkSubdomain(java.lang.String login,
 
                                       java.lang.String password,
 
                                       java.lang.String password,
 
                                       long dirId,
 
                                       long dirId,
Line 48: Line 48:
 
== createNewFolder ==
 
== createNewFolder ==
  
public long createNewFolder(java.lang.String login,
+
  public long createNewFolder(java.lang.String login,
 
                             java.lang.String password,
 
                             java.lang.String password,
 
                             long dirID,
 
                             long dirID,
Line 67: Line 67:
 
== createUploadSessionKey ==
 
== createUploadSessionKey ==
  
public java.lang.String createUploadSessionKey(java.lang.String login,
+
  public java.lang.String createUploadSessionKey(java.lang.String login,
 
                                               java.lang.String password,
 
                                               java.lang.String password,
 
                                               long dirID)
 
                                               long dirID)
Line 79: Line 79:
 
Returns:
 
Returns:
 
   session key
 
   session key
 
== creatNewFolder ==
 
 
@Deprecated
 
public boolean creatNewFolder(java.lang.String login,
 
                                        java.lang.String password,
 
                                        long dirID,
 
                                        java.lang.String folderName)
 
 
    Deprecated.
 
  
 
== deleteFile ==
 
== deleteFile ==
  
public void deleteFile(java.lang.String login,
+
  public void deleteFile(java.lang.String login,
 
                       java.lang.String password,
 
                       java.lang.String password,
 
                       long fileID)
 
                       long fileID)
Line 105: Line 95:
 
== deleteFolder ==
 
== deleteFolder ==
  
public void deleteFolder(java.lang.String login,
+
  public void deleteFolder(java.lang.String login,
 
                         java.lang.String password,
 
                         java.lang.String password,
 
                         long dirID)
 
                         long dirID)
  
    Completely removes folder and puts all of it contents to recycle bin
+
Completely removes folder and puts all of it contents to recycle bin
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirID - id of the directory to be removed
+
  dirID - id of the directory to be removed
  
downloadFinished
+
== downloadFinished ==
  
public void downloadFinished(java.lang.String login,
+
  public void downloadFinished(java.lang.String login,
 
                             java.lang.String password,
 
                             java.lang.String password,
 
                             long fileId)
 
                             long fileId)
  
    Have to be called after full file download
+
Have to be called after full file download
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileId - id of the file which was downloaded
+
  fileId - id of the file which was downloaded
  
getAllFolders
+
== getAllFolders ==
  
public com.pmstation.shared.soap.api.AccountItem[] getAllFolders(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem[] getAllFolders(java.lang.String login,
 
                                                                 java.lang.String password)
 
                                                                 java.lang.String password)
  
    Returns all of the folders in user's root directory
+
Returns all of the folders in user's root directory
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        Array of info records about user's root folder subfolders
+
  Array of info records about user's root folder subfolders
    See Also:
+
        AccountItem
+
  
getAllItems
+
== getAllItems ==
  
public com.pmstation.shared.soap.api.AccountItem[] getAllItems(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem[] getAllItems(java.lang.String login,
 
                                                               java.lang.String password)
 
                                                               java.lang.String password)
  
    Returns info about all items in user's root folder
+
Returns info about all items in user's root folder
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        Array of info records about user's root folder content
+
  Array of info records about user's root folder content
  
getCurrentUploaderVersion
+
== getCurrentUploaderVersion ==
  
public long getCurrentUploaderVersion()
+
  public long getCurrentUploaderVersion()
  
    Returns last uploader version. If this increase you should consider to look at online api documentation to check changes. We will try to maintain backward compatibility but this is not guaranteed.
+
Returns last uploader version. If this increase you should consider to look at online api documentation to check changes. We will try to maintain backward compatibility but this is not guaranteed.
  
    Returns:
+
Returns:
        Uploader version
+
  Uploader version
  
getDirectLink
+
== getDirectLink ==
  
public java.lang.String getDirectLink(java.lang.String login,
+
  public java.lang.String getDirectLink(java.lang.String login,
 
                                       java.lang.String password,
 
                                       java.lang.String password,
 
                                       java.lang.String link)
 
                                       java.lang.String link)
  
    Returns link to start immediate downloading. Not always possible however, because we are ads-supported mostly. Returns link starting with "http" if ok.
+
Returns link to start immediate downloading. Not always possible however, because we are ads-supported mostly. Returns link starting with "http" if ok.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        link - indirect download link
+
  link - indirect download link
  
getDirInfo
+
== getDirInfo ==
  
public com.pmstation.shared.soap.api.AccountItem getDirInfo(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem getDirInfo(java.lang.String login,
 
                                                             java.lang.String password,
 
                                                             java.lang.String password,
 
                                                             long dirID)
 
                                                             long dirID)
  
    Return info about specified folder
+
Return info about specified folder
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirID - id of the folder  
+
  dirID - id of the folder  
    Returns:
+
Returns:
        folder info
+
  folder info
    See Also:
+
        AccountItem
+
  
getFileDownloadLink
+
== getFileDownloadLink ==
  
public java.lang.String getFileDownloadLink(java.lang.String login,
+
  public java.lang.String getFileDownloadLink(java.lang.String login,
 
                                             java.lang.String password,
 
                                             java.lang.String password,
 
                                             long fileID)
 
                                             long fileID)
  
    Returns download link for user owned file
+
Returns download link for user owned file
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileID - id of file to be downloaded  
+
  fileID - id of file to be downloaded  
    Returns:
+
Returns:
        Download link or empty string if some errors occurs.
+
  Download link or empty string if some errors occurs.
  
getFileInfo
+
== getFileInfo ==
  
public com.pmstation.shared.soap.api.AccountItem getFileInfo(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem getFileInfo(java.lang.String login,
 
                                                             java.lang.String password,
 
                                                             java.lang.String password,
 
                                                             long fileID)
 
                                                             long fileID)
  
    Returns info about file
+
Returns info about file
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileID - id of file to get info about  
+
  fileID - id of file to get info about  
    Returns:
+
Returns:
        file info
+
  file info
    See Also:
+
        AccountItem
+
  
getFolderSharingProperties
+
== getFolderSharingProperties ==
  
public com.pmstation.shared.soap.api.SharedFolderProperties[] getFolderSharingProperties(java.lang.String login,
+
  public com.pmstation.shared.soap.api.SharedFolderProperties[] getFolderSharingProperties(java.lang.String login,
 
                                                                                         java.lang.String password,
 
                                                                                         java.lang.String password,
 
                                                                                         long dirId)
 
                                                                                         long dirId)
  
    Returns folder sharing properties. Output is two element array: res[0] - actual values. res[1] - properties which can be set for this user is marked as true.
+
Returns folder sharing properties. Output is two element array: res[0] - actual values. res[1] - properties which can be set for this user is marked as true.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirId - id of the folder to properties for  
+
  dirId - id of the folder to properties for  
    Returns:
+
Returns:
        folder sharing properties
+
  folder sharing properties
    See Also:
+
        SharedFolderProperties
+
  
getFreeSpace
+
== getFreeSpace ==
  
public long getFreeSpace(java.lang.String login,
+
  public long getFreeSpace(java.lang.String login,
 
                         java.lang.String password)
 
                         java.lang.String password)
  
    Gets free space left for user
+
Gets free space left for user
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        free space left for user in bytes
+
  free space left for user in bytes
  
getHistory
+
== getHistory ==
  
public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistory(java.lang.String login,
+
  public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistory(java.lang.String login,
 
                                                                 java.lang.String password,
 
                                                                 java.lang.String password,
 
                                                                 long dirId)
 
                                                                 long dirId)
  
    Returns history of operations in specified folder and subfolders. For operation field meanings see getOperationDescriptions()
+
Returns history of operations in specified folder and subfolders. For operation field meanings see getOperationDescriptions()
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirId - id of folder  
+
  dirId - id of folder  
    Returns:
+
Returns:
        Array of folder changes. May be null or empty
+
  Array of folder changes. May be null or empty
    See Also:
+
        DirHistoryDTO
+
  
getHistoryFromId
+
== getHistoryFromId ==
  
public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistoryFromId(java.lang.String login,
+
  public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistoryFromId(java.lang.String login,
 
                                                                       java.lang.String password,
 
                                                                       java.lang.String password,
 
                                                                       long dirId,
 
                                                                       long dirId,
 
                                                                       long fromId)
 
                                                                       long fromId)
  
    Returns history of operations which occurs in specified folder and subfolders with history id more then specified. For operation field meanings see getOperationDescriptions()
+
Returns history of operations which occurs in specified folder and subfolders with history id more then specified. For operation field meanings see getOperationDescriptions()
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirId - id of folder to take history for
+
  dirId - id of folder to take history for
        fromId - id floor of history  
+
  fromId - id floor of history  
    Returns:
+
Returns:
        Array of folder changes. May be null or empty
+
  Array of folder changes. May be null or empty
    See Also:
+
        DirHistoryDTO
+
  
getItemInfo
+
== getItemInfo ==
  
public com.pmstation.shared.soap.api.AccountItem getItemInfo(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem getItemInfo(java.lang.String login,
 
                                                             java.lang.String password,
 
                                                             java.lang.String password,
 
                                                             long itemID,
 
                                                             long itemID,
 
                                                             boolean dir)
 
                                                             boolean dir)
  
    Common method for getFileInfo(String, String, long) and getDirInfo(String, String, long) distinguished by value of dir parameter
+
Common method for getFileInfo(String, String, long) and getDirInfo(String, String, long) distinguished by value of dir parameter
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        itemID - id of element
+
  itemID - id of element
        dir - if true then supplied Id is folder and file otherwise  
+
  dir - if true then supplied Id is folder and file otherwise  
    Returns:
+
Returns:
  
getItems
+
== getItems ==
  
public com.pmstation.shared.soap.api.AccountItem[] getItems(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem[] getItems(java.lang.String login,
 
                                                             java.lang.String password,
 
                                                             java.lang.String password,
 
                                                             long dirID)
 
                                                             long dirID)
  
    Returns array of infos about contents of specified dir.
+
Returns array of infos about contents of specified dir.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirID - id of folder to list  
+
  dirID - id of folder to list (-1 for root)
    Returns:
+
Returns:
        Array of info items
+
  Array of info items
    See Also:
+
        AccountItem
+
  
getMaxFileSize
+
== getMaxFileSize ==
  
public long getMaxFileSize(java.lang.String login,
+
  public long getMaxFileSize(java.lang.String login,
 
                           java.lang.String password)
 
                           java.lang.String password)
  
    Return maximum allowed file size for specified user
+
Return maximum allowed file size for specified user
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        maximum allowed file size in bytes
+
  maximum allowed file size in bytes
  
getNewFileDataCenter
+
== getNewFileDataCenter ==
  
public long getNewFileDataCenter(java.lang.String login,
+
  public long getNewFileDataCenter(java.lang.String login,
 
                                 java.lang.String password)
 
                                 java.lang.String password)
  
    Returns datacenter id to upload files to
+
Returns datacenter id to upload files to
  
    Specified by:
+
Parameters:
        getNewFileDataCenter in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  login - user login
 +
  password - user password
 +
Returns:
 +
  datacenter id to upload new files to
  
    Parameters:
+
== getNotOwnedSizeLimit ==
        login - user login
+
        password - user password
+
    Returns:
+
        datacenter id to upload new files to
+
  
getNotOwnedSizeLimit
+
  public long getNotOwnedSizeLimit()
  
public long getNotOwnedSizeLimit()
+
Max file size which can be downloaded without speed limit
  
    Max file size which can be downloaded without speed limit
+
Returns:
 
+
  max file size which can be downloaded without speed limit
    Returns:
+
        max file size which can be downloaded without speed limit
+
  
getOperationDescriptions
+
== getOperationDescriptions ==
  
 
public java.lang.String[] getOperationDescriptions()
 
public java.lang.String[] getOperationDescriptions()
  
    Returns array of OperationEnum names. Array index corresponds to values which can be returned as DirHistoryDTO.getOperation(). Array is supposed to be zero-based.
+
Returns array of OperationEnum names. Array index corresponds to values which can be returned as DirHistoryDTO.getOperation(). Array is supposed to be zero-based.
  
    Returns:
+
Returns:
        array of OperationEnum names
+
  array of OperationEnum names
  
getOwnedSizeLimit
+
== getRecycleBinItems ==
  
public long getOwnedSizeLimit()
+
  public com.pmstation.shared.soap.api.AccountItem[] getRecycleBinItems(java.lang.String login,
 
+
    Can be used only thru official 4shared Desktop
+
 
+
    Returns:
+
        value has no meaning outside of 4shared Desktop
+
 
+
getRecycleBinItems
+
 
+
public com.pmstation.shared.soap.api.AccountItem[] getRecycleBinItems(java.lang.String login,
+
 
                                                                       java.lang.String password)
 
                                                                       java.lang.String password)
  
    Returns info about files in recycle bin
+
Returns info about files in recycle bin
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        Array of recycle bin content info items
+
  Array of recycle bin content info items
    See Also:
+
        AccountItem
+
  
getSharedDirItems
+
== getSharedDirItems ==
  
public com.pmstation.shared.soap.api.AccountItem[] getSharedDirItems(java.lang.String login,
+
  public com.pmstation.shared.soap.api.AccountItem[] getSharedDirItems(java.lang.String login,
 
                                                                     java.lang.String password,
 
                                                                     java.lang.String password,
 
                                                                     long dirID,
 
                                                                     long dirID,
Line 406: Line 368:
 
                                                                     java.lang.String userDirPassword)
 
                                                                     java.lang.String userDirPassword)
  
    Return content of possibly not owned shared folder
+
Return content of possibly not owned shared folder
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirID - id of folder to view
+
  dirID - id of folder to view
        dirPassword - 4shared generated dir password
+
  dirPassword - 4shared generated dir password
        userDirPassword - user set dir password if needed  
+
  userDirPassword - user set dir password if needed  
    Returns:
+
Returns:
        content of specified shared folder or null
+
  content of specified shared folder or null
  
getSpaceLimit
+
== getSpaceLimit ==
  
public long getSpaceLimit(java.lang.String login,
+
  public long getSpaceLimit(java.lang.String login,
 
                           java.lang.String password)
 
                           java.lang.String password)
  
    Returns user space limit
+
Returns user space limit
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        space limit
+
  space limit
  
getUploadFormUrl
+
== getUploadFormUrl ==
  
 
public java.lang.String getUploadFormUrl(int dataCenterID,
 
public java.lang.String getUploadFormUrl(int dataCenterID,
 
                                         java.lang.String sessionKey)
 
                                         java.lang.String sessionKey)
  
    Returns url to upload file to.
+
Returns url to upload file to.
  
    Specified by:
+
Parameters:
        getUploadFormUrl in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  dataCenterID - id of datacenter to upload to
 +
  sessionKey - upload session key
  
    Parameters:
+
== hasRightUpload ==
        dataCenterID - id of datacenter to upload to
+
        sessionKey - upload session key
+
  
hasRightUpload
+
  public boolean hasRightUpload()
  
public boolean hasRightUpload()
+
Whether upload feature is on.
  
    Whether upload feature is on.
+
Returns:
 +
  whether upload feature is on.
  
    Returns:
+
== isAccountActive ==
        whether upload feature is on.
+
  
isAccountActive
+
  public boolean isAccountActive(java.lang.String login,
 
+
public boolean isAccountActive(java.lang.String login,
+
 
                               java.lang.String password)
 
                               java.lang.String password)
  
    Checks account availability
+
Checks account availability
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        true if account is active
+
  true if account is active
  
isAccountBanned
+
== isAccountBanned ==
  
public boolean isAccountBanned(java.lang.String login,
+
  public boolean isAccountBanned(java.lang.String login,
 
                               java.lang.String password)
 
                               java.lang.String password)
  
    Checks if user account is banned
+
Checks if user account is banned
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        true if user accont is banned
+
  true if user accont is banned
  
isAccountPremium
+
== isAccountPremium ==
  
public boolean isAccountPremium(java.lang.String login,
+
  public boolean isAccountPremium(java.lang.String login,
 
                                 java.lang.String password)
 
                                 java.lang.String password)
  
    Checks if user account is premium
+
Checks if user account is premium
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        true of user has premium account
+
  true of user has premium account
  
isExistsLoginPassword
+
== isExistsLoginPassword ==
  
public boolean isExistsLoginPassword(java.lang.String login,
+
  public boolean isExistsLoginPassword(java.lang.String login,
 
                                     java.lang.String password)
 
                                     java.lang.String password)
  
    true-false version of login
+
true-false version of login
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        true if login was successful
+
  true if login was successful
  
login
+
== login ==
  
public java.lang.String login(java.lang.String login,
+
  public java.lang.String login(java.lang.String login,
 
                               java.lang.String password)
 
                               java.lang.String password)
  
    Login
+
Login
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password  
+
  password - user password  
    Returns:
+
Returns:
        Empty string if all ok, diagnostic message otherwise
+
  Empty string if all ok, diagnostic message otherwise
  
markSynchronized
+
== markSynchronized ==
  
public void markSynchronized(java.lang.String login,
+
  public void markSynchronized(java.lang.String login,
 
                             java.lang.String password,
 
                             java.lang.String password,
 
                             long dirId)
 
                             long dirId)
  
    Informs 4shared to write folder and subfolders usage history
+
Informs 4shared to write folder and subfolders usage history
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirId - id of folder to write history for
+
  dirId - id of folder to write history for
  
pasteFilesDirs
+
== pasteFilesDirs ==
  
public java.lang.String pasteFilesDirs(java.lang.String login,
+
  public java.lang.String pasteFilesDirs(java.lang.String login,
 
                                       java.lang.String password,
 
                                       java.lang.String password,
 
                                       long toFolderId,
 
                                       long toFolderId,
Line 540: Line 499:
 
                                       long[] dirIds)
 
                                       long[] dirIds)
  
    Copy-pastes or cut-pastes a group of files and dirs. Use this to copy or move a group of files to another directory.
+
Copy-pastes or cut-pastes a group of files and dirs. Use this to copy or move a group of files to another directory.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        toFolderId - target folder id
+
  toFolderId - target folder id
        makeCopy - - exec copy+paste if true, exec cut+paste if false
+
  makeCopy - - exec copy+paste if true, exec cut+paste if false
        fileIds - ids of file to be moved/copied
+
  fileIds - ids of file to be moved/copied
        dirIds - ids of folders to be moved/copied  
+
  dirIds - ids of folders to be moved/copied  
    Returns:
+
Returns:
        diagnostic message or empty string if all ok
+
  diagnostic message or empty string if all ok
  
renameFile
+
== renameFile ==
  
public long renameFile(java.lang.String login,
+
  public long renameFile(java.lang.String login,
 
                       java.lang.String password,
 
                       java.lang.String password,
 
                       long fileID,
 
                       long fileID,
 
                       java.lang.String newName)
 
                       java.lang.String newName)
  
    Renames specified file
+
Renames specified file
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileID - id of file to be renamed
+
  fileID - id of file to be renamed
        newName - new name of file  
+
  newName - new name of file  
    Returns:
+
Returns:
        -1 if file exists, 0 in case of other failures, fileID if rename was successful
+
  -1 if file exists,  
 +
  0 in case of other failures,  
 +
  fileID if rename was successful
  
renameFolder
+
== renameFolder ==
  
public long renameFolder(java.lang.String login,
+
  public long renameFolder(java.lang.String login,
 
                         java.lang.String password,
 
                         java.lang.String password,
 
                         long dirID,
 
                         long dirID,
 
                         java.lang.String newName)
 
                         java.lang.String newName)
  
    Renames specified folder
+
Renames specified folder
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirID - id of folder to be renamed
+
  dirID - id of folder to be renamed
        newName - new name of folder  
+
  newName - new name of folder  
    Returns:
+
Returns:
        -1 if file exists, 0 in case of other failures, dirID if rename was successful
+
  -1 if file exists,  
 +
  0 in case of other failures,  
 +
  dirID if rename was successful
  
restoreFile
+
== restoreFile ==
  
public void restoreFile(java.lang.String login,
+
  public void restoreFile(java.lang.String login,
 
                         java.lang.String password,
 
                         java.lang.String password,
 
                         long fileID)
 
                         long fileID)
  
    Restores file from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.
+
Restores file from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileID - id of file to be restored
+
  fileID - id of file to be restored
  
restoreFiles
+
== restoreFiles ==
  
public void restoreFiles(java.lang.String login,
+
  public void restoreFiles(java.lang.String login,
 
                         java.lang.String password,
 
                         java.lang.String password,
 
                         long[] fileIDs)
 
                         long[] fileIDs)
  
    Restores group of files from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.
+
Restores group of files from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileIDs - Array of file ids to be restored
+
  fileIDs - Array of file ids to be restored
  
setFolderSharingProperties
+
== setFolderSharingProperties ==
  
public java.lang.String setFolderSharingProperties(java.lang.String login,
+
  public java.lang.String setFolderSharingProperties(java.lang.String login,
 
                                                   java.lang.String password,
 
                                                   java.lang.String password,
 
                                                   long dirId,
 
                                                   long dirId,
 
                                                   com.pmstation.shared.soap.api.SharedFolderProperties folderProperties)
 
                                                   com.pmstation.shared.soap.api.SharedFolderProperties folderProperties)
  
    Sets folder sharing properties
+
Sets folder sharing properties
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        dirId - id of folder to set properties for
+
  dirId - id of folder to set properties for
        folderProperties - new properties values  
+
  folderProperties - new properties values  
    Returns:
+
Returns:
        Diagnostic message or empty string if all is ok
+
  Diagnostic message or empty string if all is ok
  
signup
+
== signup ==
  
public java.lang.String signup(java.lang.String login,
+
  public java.lang.String signup(java.lang.String login,
 
                               java.lang.String password)
 
                               java.lang.String password)
  
    Creates new User and sends confirmation email.
+
Creates new User and sends confirmation email.
  
    Parameters:
+
Parameters:
        login - desired login
+
  login - desired login
        password - password  
+
  password - password  
    Returns:
+
Returns:
        error message if any. Empty string if all ok.
+
  error message if any. Empty string if all ok.
  
syncFinished
+
== syncFinished ==
  
public void syncFinished(java.lang.String login,
+
  public void syncFinished(java.lang.String login,
 
                         java.lang.String password,
 
                         java.lang.String password,
 
                         long fileId)
 
                         long fileId)
  
    Should be called in the end of each sync operation
+
Should be called in the end of each sync operation
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileId - which file was synced. -1 if not applicable
+
  fileId - which file was synced. -1 if not applicable
  
uploadCancelFile
+
== uploadCancelFile ==
  
public void uploadCancelFile(java.lang.String login,
+
  public void uploadCancelFile(java.lang.String login,
 
                             java.lang.String password,
 
                             java.lang.String password,
 
                             long fileId)
 
                             long fileId)
  
    Call if upload was canceled
+
Call if upload was canceled
  
    Specified by:
+
Parameters:
        uploadCancelFile in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  login - user login
 
+
  password - user password
    Parameters:
+
  fileId - id of file which upload is canceling
        login - user login
+
        password - user password
+
        fileId - id of file which upload is canceling
+
  
uploaderLoggedIn
+
== uploadFinishFile ==
  
public boolean uploaderLoggedIn(java.lang.String login,
+
  public java.lang.String uploadFinishFile(java.lang.String login,
                                java.lang.String password,
+
                                java.lang.String uploaderVersion,
+
                                java.lang.String macAddress)
+
 
+
    For 4shared Desktop use only
+
 
+
    Parameters:
+
        login -
+
        password -
+
        uploaderVersion -
+
        macAddress -
+
    Returns:
+
        nonsense
+
 
+
uploadFinishFile
+
 
+
public java.lang.String uploadFinishFile(java.lang.String login,
+
 
                                         java.lang.String password,
 
                                         java.lang.String password,
 
                                         long fileId,
 
                                         long fileId,
 
                                         java.lang.String md5)
 
                                         java.lang.String md5)
  
    Complete resumable upload
+
Complete resumable upload
  
    Specified by:
+
Parameters:
        uploadFinishFile in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  login - user login
 
+
  password - user password
    Parameters:
+
  fileId - returned from initial call to uploadStartFile() - existing file in 'being uploaded by parts' state
        login - user login
+
  md5 - original file MD5 to verify file consistency at server side  
        password - user password
+
Returns:
        fileId - - returned from initial call to uploadStartFile() - existing file in 'being uploaded by parts' state
+
  empty string if success or error message
        md5 - - original file MD5 to verify file consistency at server side  
+
    Returns:
+
        - empty string if success or error message
+
  
uploadStartedFileExists
+
== uploadStartedFileExists ==
  
public boolean uploadStartedFileExists(java.lang.String login,
+
  public boolean uploadStartedFileExists(java.lang.String login,
 
                                       java.lang.String password,
 
                                       java.lang.String password,
 
                                       long fileId)
 
                                       long fileId)
  
    Checks if file was partially uploaded
+
Checks if file was partially uploaded
  
    Parameters:
+
Parameters:
        login - user login
+
  login - user login
        password - user password
+
  password - user password
        fileId - id of file to be checked  
+
  fileId - id of file to be checked  
    Returns:
+
Returns:
        true if there is part of file already uploaded.
+
  true if there is part of file already uploaded.
  
uploadStartFile
+
== uploadStartFile ==
  
public long uploadStartFile(java.lang.String login,
+
  public long uploadStartFile(java.lang.String login,
 
                             java.lang.String password,
 
                             java.lang.String password,
 
                             long dirID,
 
                             long dirID,
Line 731: Line 671:
 
                             long fullSize)
 
                             long fullSize)
  
    Resumable upload - start
+
Resumable upload - start
  
    Specified by:
+
Parameters:
        uploadStartFile in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  dirID - (-1) means upload to user's root dir
 +
Returns:
 +
  fileId to pass as parameter in all subsequent partial uploads
  
    Parameters:
+
== uploadStartFileUpdate ==
        dirID - (-1) means upload to user's root dir
+
    Returns:
+
        fileId to pass as parameter in all subsequent partial uploads
+
  
uploadStartFileUpdate
+
  public long uploadStartFileUpdate(java.lang.String login,
 
+
public long uploadStartFileUpdate(java.lang.String login,
+
 
                                   java.lang.String password,
 
                                   java.lang.String password,
 
                                   long updateFileId,
 
                                   long updateFileId,
Line 749: Line 686:
 
                                   long fullSize)
 
                                   long fullSize)
  
    Update file
+
Update file
  
    Specified by:
+
Parameters:
        uploadStartFileUpdate in interface com.pmstation.shared.soap.api.DesktopAppIntf
+
  login - user login
 
+
  password - user password
    Parameters:
+
  updateFileId - it of original file to be updated
        login - user login
+
  name - empty string means don't change existing name
        password - user password
+
  fullSize -  
        updateFileId - it of original file to be updated
+
Returns:
        name - - empty string means don't change existing name
+
  id of temporary file uploading of which will cause update of original file
        fullSize -  
+
    Returns:
+
        - id of temporary file uploading of which will cause update of original file
+

Revision as of 14:25, 29 March 2010

4Shared are happy to present SOAP API description

---

checkSharedDirAccess

 public int checkSharedDirAccess(java.lang.String login,
                               java.lang.String password,
                               long dirID,
                               java.lang.String dirPassword,
                               java.lang.String userDirPassword)

Checks if directory can be accessed by specified user with specified passwords

Parameters:

       login - is user login
       password - is user password
       dirID - id of the directory to be accessed
       dirPassword - generated password to view contents of not owned folders
       userDirPassword - user specified password 

Returns:

Status.
0 	ok
1 	no such dir
2 	owner inactive
3 	abused dir
4 	incorrect dirPassword
5 	dir is not shared
6 	owner is banned
8 	incorrect userDirPassword

checkSubdomain

 public java.lang.String checkSubdomain(java.lang.String login,
                                      java.lang.String password,
                                      long dirId,
                                      java.lang.String subdomainName)

Checks if subdomain can be set for specified folder

Parameters:

 login - user login
 password - user password
 dirId - id of the directory
 subdomainName - name to be set 

Returns:

 Empty string or null if everything is ok and error message otherwise

createNewFolder

 public long createNewFolder(java.lang.String login,
                           java.lang.String password,
                           long dirID,
                           java.lang.String folderName)

Creates new folder as dirId subfolder

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to create folder in
 folderName - new folder name 

Returns:

 0 - if creation denied, newly created dir ID otherwise 
 -1 - already exists 
 -2 - attempt to create folder in removed parent

createUploadSessionKey

 public java.lang.String createUploadSessionKey(java.lang.String login,
                                              java.lang.String password,
                                              long dirID)

Creates session key for uploading file

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to upload to 

Returns:

 session key

deleteFile

 public void deleteFile(java.lang.String login,
                      java.lang.String password,
                      long fileID)

Removes file to recycle bin or from recycle bin if it is already there

Parameters:

 login - user login
 password - user password
 fileID - id of the file to be removed

deleteFolder

 public void deleteFolder(java.lang.String login,
                        java.lang.String password,
                        long dirID)

Completely removes folder and puts all of it contents to recycle bin

Parameters:

 login - user login
 password - user password
 dirID - id of the directory to be removed

downloadFinished

 public void downloadFinished(java.lang.String login,
                            java.lang.String password,
                            long fileId)

Have to be called after full file download

Parameters:

 login - user login
 password - user password
 fileId - id of the file which was downloaded

getAllFolders

 public com.pmstation.shared.soap.api.AccountItem[] getAllFolders(java.lang.String login,
                                                                java.lang.String password)

Returns all of the folders in user's root directory

Parameters:

 login - user login
 password - user password 

Returns:

 Array of info records about user's root folder subfolders

getAllItems

 public com.pmstation.shared.soap.api.AccountItem[] getAllItems(java.lang.String login,
                                                              java.lang.String password)

Returns info about all items in user's root folder

Parameters:

 login - user login
 password - user password 

Returns:

 Array of info records about user's root folder content

getCurrentUploaderVersion

 public long getCurrentUploaderVersion()

Returns last uploader version. If this increase you should consider to look at online api documentation to check changes. We will try to maintain backward compatibility but this is not guaranteed.

Returns:

 Uploader version

getDirectLink

 public java.lang.String getDirectLink(java.lang.String login,
                                     java.lang.String password,
                                     java.lang.String link)

Returns link to start immediate downloading. Not always possible however, because we are ads-supported mostly. Returns link starting with "http" if ok.

Parameters:

 login - user login
 password - user password
 link - indirect download link

getDirInfo

 public com.pmstation.shared.soap.api.AccountItem getDirInfo(java.lang.String login,
                                                           java.lang.String password,
                                                           long dirID)

Return info about specified folder

Parameters:

 login - user login
 password - user password
 dirID - id of the folder 

Returns:

 folder info

getFileDownloadLink

 public java.lang.String getFileDownloadLink(java.lang.String login,
                                           java.lang.String password,
                                           long fileID)

Returns download link for user owned file

Parameters:

 login - user login
 password - user password
 fileID - id of file to be downloaded 

Returns:

 Download link or empty string if some errors occurs.

getFileInfo

 public com.pmstation.shared.soap.api.AccountItem getFileInfo(java.lang.String login,
                                                            java.lang.String password,
                                                            long fileID)

Returns info about file

Parameters:

 login - user login
 password - user password
 fileID - id of file to get info about 

Returns:

 file info

getFolderSharingProperties

 public com.pmstation.shared.soap.api.SharedFolderProperties[] getFolderSharingProperties(java.lang.String login,
                                                                                        java.lang.String password,
                                                                                        long dirId)

Returns folder sharing properties. Output is two element array: res[0] - actual values. res[1] - properties which can be set for this user is marked as true.

Parameters:

 login - user login
 password - user password
 dirId - id of the folder to properties for 

Returns:

 folder sharing properties

getFreeSpace

 public long getFreeSpace(java.lang.String login,
                        java.lang.String password)

Gets free space left for user

Parameters:

 login - user login
 password - user password 

Returns:

 free space left for user in bytes

getHistory

 public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistory(java.lang.String login,
                                                               java.lang.String password,
                                                               long dirId)

Returns history of operations in specified folder and subfolders. For operation field meanings see getOperationDescriptions()

Parameters:

 login - user login
 password - user password
 dirId - id of folder 

Returns:

 Array of folder changes. May be null or empty

getHistoryFromId

 public com.pmstation.shared.soap.api.DirHistoryDTO[] getHistoryFromId(java.lang.String login,
                                                                     java.lang.String password,
                                                                     long dirId,
                                                                     long fromId)

Returns history of operations which occurs in specified folder and subfolders with history id more then specified. For operation field meanings see getOperationDescriptions()

Parameters:

 login - user login
 password - user password
 dirId - id of folder to take history for
 fromId - id floor of history 

Returns:

 Array of folder changes. May be null or empty

getItemInfo

 public com.pmstation.shared.soap.api.AccountItem getItemInfo(java.lang.String login,
                                                            java.lang.String password,
                                                            long itemID,
                                                            boolean dir)

Common method for getFileInfo(String, String, long) and getDirInfo(String, String, long) distinguished by value of dir parameter

Parameters:

 login - user login
 password - user password
 itemID - id of element
 dir - if true then supplied Id is folder and file otherwise 

Returns:

getItems

 public com.pmstation.shared.soap.api.AccountItem[] getItems(java.lang.String login,
                                                           java.lang.String password,
                                                           long dirID)

Returns array of infos about contents of specified dir.

Parameters:

 login - user login
 password - user password
 dirID - id of folder to list (-1 for root)

Returns:

 Array of info items

getMaxFileSize

 public long getMaxFileSize(java.lang.String login,
                          java.lang.String password)

Return maximum allowed file size for specified user

Parameters:

 login - user login
 password - user password 

Returns:

 maximum allowed file size in bytes

getNewFileDataCenter

 public long getNewFileDataCenter(java.lang.String login,
                                java.lang.String password)

Returns datacenter id to upload files to

Parameters:

 login - user login
 password - user password 

Returns:

 datacenter id to upload new files to

getNotOwnedSizeLimit

 public long getNotOwnedSizeLimit()

Max file size which can be downloaded without speed limit

Returns:

 max file size which can be downloaded without speed limit

getOperationDescriptions

public java.lang.String[] getOperationDescriptions()

Returns array of OperationEnum names. Array index corresponds to values which can be returned as DirHistoryDTO.getOperation(). Array is supposed to be zero-based.

Returns:

 array of OperationEnum names

getRecycleBinItems

 public com.pmstation.shared.soap.api.AccountItem[] getRecycleBinItems(java.lang.String login,
                                                                     java.lang.String password)

Returns info about files in recycle bin

Parameters:

 login - user login
 password - user password 

Returns:

 Array of recycle bin content info items

getSharedDirItems

 public com.pmstation.shared.soap.api.AccountItem[] getSharedDirItems(java.lang.String login,
                                                                    java.lang.String password,
                                                                    long dirID,
                                                                    java.lang.String dirPassword,
                                                                    java.lang.String userDirPassword)

Return content of possibly not owned shared folder

Parameters:

 login - user login
 password - user password
 dirID - id of folder to view
 dirPassword - 4shared generated dir password
 userDirPassword - user set dir password if needed 

Returns:

 content of specified shared folder or null

getSpaceLimit

 public long getSpaceLimit(java.lang.String login,
                         java.lang.String password)

Returns user space limit

Parameters:

 login - user login
 password - user password 

Returns:

 space limit

getUploadFormUrl

public java.lang.String getUploadFormUrl(int dataCenterID,

                                        java.lang.String sessionKey)

Returns url to upload file to.

Parameters:

 dataCenterID - id of datacenter to upload to
 sessionKey - upload session key

hasRightUpload

 public boolean hasRightUpload()

Whether upload feature is on.

Returns:

 whether upload feature is on.

isAccountActive

 public boolean isAccountActive(java.lang.String login,
                              java.lang.String password)

Checks account availability

Parameters:

 login - user login
 password - user password 

Returns:

 true if account is active

isAccountBanned

 public boolean isAccountBanned(java.lang.String login,
                              java.lang.String password)

Checks if user account is banned

Parameters:

 login - user login
 password - user password 

Returns:

 true if user accont is banned

isAccountPremium

 public boolean isAccountPremium(java.lang.String login,
                               java.lang.String password)

Checks if user account is premium

Parameters:

 login - user login
 password - user password 

Returns:

 true of user has premium account

isExistsLoginPassword

 public boolean isExistsLoginPassword(java.lang.String login,
                                    java.lang.String password)

true-false version of login

Parameters:

 login - user login
 password - user password 

Returns:

 true if login was successful

login

 public java.lang.String login(java.lang.String login,
                             java.lang.String password)

Login

Parameters:

 login - user login
 password - user password 

Returns:

 Empty string if all ok, diagnostic message otherwise

markSynchronized

 public void markSynchronized(java.lang.String login,
                            java.lang.String password,
                            long dirId)

Informs 4shared to write folder and subfolders usage history

Parameters:

 login - user login
 password - user password
 dirId - id of folder to write history for

pasteFilesDirs

 public java.lang.String pasteFilesDirs(java.lang.String login,
                                      java.lang.String password,
                                      long toFolderId,
                                      boolean makeCopy,
                                      long[] fileIds,
                                      long[] dirIds)

Copy-pastes or cut-pastes a group of files and dirs. Use this to copy or move a group of files to another directory.

Parameters:

 login - user login
 password - user password
 toFolderId - target folder id
 makeCopy - - exec copy+paste if true, exec cut+paste if false
 fileIds - ids of file to be moved/copied
 dirIds - ids of folders to be moved/copied 

Returns:

 diagnostic message or empty string if all ok

renameFile

 public long renameFile(java.lang.String login,
                      java.lang.String password,
                      long fileID,
                      java.lang.String newName)

Renames specified file

Parameters:

 login - user login
 password - user password
 fileID - id of file to be renamed
 newName - new name of file 

Returns:

 -1 if file exists, 
 0 in case of other failures, 
 fileID if rename was successful

renameFolder

 public long renameFolder(java.lang.String login,
                        java.lang.String password,
                        long dirID,
                        java.lang.String newName)

Renames specified folder

Parameters:

 login - user login
 password - user password
 dirID - id of folder to be renamed
 newName - new name of folder 

Returns:

 -1 if file exists, 
 0 in case of other failures, 
 dirID if rename was successful

restoreFile

 public void restoreFile(java.lang.String login,
                       java.lang.String password,
                       long fileID)

Restores file from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.

Parameters:

 login - user login
 password - user password
 fileID - id of file to be restored

restoreFiles

 public void restoreFiles(java.lang.String login,
                        java.lang.String password,
                        long[] fileIDs)

Restores group of files from Recycle Bin. If folder still exists restores to it, in other cases will restore to special RESTORED FILES folder which will be created if not already exists.

Parameters:

 login - user login
 password - user password
 fileIDs - Array of file ids to be restored

setFolderSharingProperties

 public java.lang.String setFolderSharingProperties(java.lang.String login,
                                                  java.lang.String password,
                                                  long dirId,
                                                  com.pmstation.shared.soap.api.SharedFolderProperties folderProperties)

Sets folder sharing properties

Parameters:

 login - user login
 password - user password
 dirId - id of folder to set properties for
 folderProperties - new properties values 

Returns:

 Diagnostic message or empty string if all is ok

signup

 public java.lang.String signup(java.lang.String login,
                              java.lang.String password)

Creates new User and sends confirmation email.

Parameters:

 login - desired login
 password - password 

Returns:

 error message if any. Empty string if all ok.

syncFinished

 public void syncFinished(java.lang.String login,
                        java.lang.String password,
                        long fileId)

Should be called in the end of each sync operation

Parameters:

 login - user login
 password - user password
 fileId - which file was synced. -1 if not applicable

uploadCancelFile

 public void uploadCancelFile(java.lang.String login,
                            java.lang.String password,
                            long fileId)

Call if upload was canceled

Parameters:

 login - user login
 password - user password
 fileId - id of file which upload is canceling

uploadFinishFile

 public java.lang.String uploadFinishFile(java.lang.String login,
                                        java.lang.String password,
                                        long fileId,
                                        java.lang.String md5)

Complete resumable upload

Parameters:

 login - user login
 password - user password
 fileId - returned from initial call to uploadStartFile() - existing file in 'being uploaded by parts' state
 md5 - original file MD5 to verify file consistency at server side 

Returns:

 empty string if success or error message

uploadStartedFileExists

 public boolean uploadStartedFileExists(java.lang.String login,
                                      java.lang.String password,
                                      long fileId)

Checks if file was partially uploaded

Parameters:

 login - user login
 password - user password
 fileId - id of file to be checked 

Returns:

 true if there is part of file already uploaded.

uploadStartFile

 public long uploadStartFile(java.lang.String login,
                           java.lang.String password,
                           long dirID,
                           java.lang.String name,
                           long fullSize)

Resumable upload - start

Parameters:

 dirID - (-1) means upload to user's root dir 

Returns:

 fileId to pass as parameter in all subsequent partial uploads

uploadStartFileUpdate

 public long uploadStartFileUpdate(java.lang.String login,
                                 java.lang.String password,
                                 long updateFileId,
                                 java.lang.String name,
                                 long fullSize)

Update file

Parameters:

 login - user login
 password - user password
 updateFileId - it of original file to be updated
 name - empty string means don't change existing name
 fullSize - 

Returns:

 id of temporary file uploading of which will cause update of original file