public interface

BoxExternalAPI

cn.com.believer.songyuanframework.openapi.storage.box.BoxExternalAPI
Known Indirect Subclasses

Summary

Public Methods
abstract AddToMyBoxResponse addToMyBox(AddToMyBoxRequest addToMyBoxRequest)
This method copies a file publicly shared by someone to a user's mybox.
abstract AddToTagResponse addToTag(AddToTagRequest addToTagRequest)
This method adds file or folder to tags list.
abstract CreateFolderResponse createFolder(CreateFolderRequest createFolderRequest)
This method creates a new folder.
abstract DeleteResponse delete(DeleteRequest deleteRequest)
This method deletes a file or folder.
abstract DownloadResponse download(DownloadRequest downloadRequest)
download a file.
abstract ExportTagsResponse exportTags(ExportTagsRequest exportTagsRequest)
This method returns all the user's tags.
abstract GetAccountTreeResponse getAccountTree(GetAccountTreeRequest getAccountTreeRequest)
This method is used to get a user's files and folders tree.
abstract GetAuthTokenResponse getAuthToken(GetAuthTokenRequest getAuthTokenRequest)
This method is used in the authorization process.
abstract GetFileInfoResponse getFileInfo(GetFileInfoRequest getFileInfoRequest)
This method gets file info.
abstract GetFriendsResponse getFriends(GetFriendsRequest getFriendsRequest)
This method is used to retrieve a list of freinds.
abstract GetTicketResponse getTicket(GetTicketRequest getTicketRequest)
This method is used in the authorization process.
abstract LogoutResponse logout(LogoutRequest logoutRequest)
This method is used to logout a user.
abstract MoveResponse move(MoveRequest moveRequest)
This method moves a file or folder to another folder.
abstract PrivateShareResponse privateShare(PrivateShareRequest privateShareRequest)
This method privately shares a file or folder with another user(s).
abstract PublicShareResponse publicShare(PublicShareRequest publicShareRequest)
This method publicly shares a file or folder.
abstract PublicUnshareResponse publicUnshare(PublicUnshareRequest publicUnshareRequest)
This method unshares a shared file or folder.
abstract RegisterNewUserResponse registerNewUser(RegisterNewUserRequest registerNewUserRequest)
This method is used to register a user.
abstract RenameResponse rename(RenameRequest renameRequest)
This method renames a file or folder.
abstract RequestFriendsResponse requestFriends(RequestFriendsRequest requestFriendsRequest)
This method requests new friends to be added to your network.
abstract SetDescriptionResponse setDescription(SetDescriptionRequest setDescriptionRequest)
This method sets a description to a file or folder.
abstract UploadResponse upload(UploadRequest uploadRequest)
upload files.
abstract VerifyRegistrationEmailResponse verifyRegistrationEmail(VerifyRegistrationEmailRequest verifyRegistrationEmailRequest)
This method is used to verify user registration email .

Public Methods

public abstract AddToMyBoxResponse addToMyBox (AddToMyBoxRequest addToMyBoxRequest)

This method copies a file publicly shared by someone to a user's mybox. 'file_id' and 'public_name' params identify a publicly shared file, you should provide either file_id or public name (like '31nhke0ahp') as a parameter. 'folder_id' is the id of a user's folder, where files are to be copied. On a successful result, the status will be 'addtomybox_ok'. If the result wasn't successful, the status field can be: 'addtomybox_error', 'not_logged_id', 'application_restricted', 's_link_exists'.

Parameters
addToMyBoxRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract AddToTagResponse addToTag (AddToTagRequest addToTagRequest)

This method adds file or folder to tags list. 'target' param can be either 'file' or 'folder' depending on what do you want to add, 'target_id' is the id of a file or folder to be added, 'tags' array of tags where target will be added. On successful a result, you will receive 'addtotag_ok'. If the result wasn't successful, status field can be: addtotag_error.

Parameters
addToTagRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract CreateFolderResponse createFolder (CreateFolderRequest createFolderRequest)

This method creates a new folder. 'parent_id' param is the id of a folder in which a new folder will be created, 'name' param is the name of a new folder. Set 'share' to 1 if you want to share a folder publicly. On a successful result, the status will be 'create_ok'. If the result wasn't successful, status field can be: 'e_no_parent_folder', 'not_logged_in', 'application_r'stricted'.

Parameters
createFolderRequest Request object
Returns
  • response object
Throws
IOException io exception
BoxException box exception

public abstract DeleteResponse delete (DeleteRequest deleteRequest)

This method deletes a file or folder. 'target' param can be either 'file' or 'folder' depending on what you want to delete, 'target_id' is id of a file or folder to be deleted. On a successful result, the status will be 's_delete_node'. If the result wasn't successful, status field can be: 'e_delete_node', 'not_logged_in', 'application_restricted'.

Parameters
deleteRequest Request object
Returns
  • response object
Throws
IOException io exception
BoxException box exception

public abstract DownloadResponse download (DownloadRequest downloadRequest)

download a file.

Parameters
downloadRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract ExportTagsResponse exportTags (ExportTagsRequest exportTagsRequest)

This method returns all the user's tags. On successful a result, you will receive 'export_tags_ok' and tag_xml will be base64 encoded tags xml. After decoding tag_xml you will get xml like this: music mp3 If the result wasn't successful, status field can be: not_logged_id, application_restricted.

Parameters
exportTagsRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract GetAccountTreeResponse getAccountTree (GetAccountTreeRequest getAccountTreeRequest)

This method is used to get a user's files and folders tree. 'folder_id' param defines root folder from which the tree begins. 'params' is array of string where you can set additional parameters, which are: onelevel - make a tree of one level depth, so you will get only files and folders stored in folder which folder_id you have provided. nofiles - include folders only in result tree, no files. nozip - do not zip tree xml. On successful result you will receive 'listing_ok' as status and base64 encoded zipped tree xml. So you have to decode the received tree, then unzip it (if you haven't set 'nozip' param) and you will get xml like this: (note that updatedand createdare UNIX timestamps in PST).

Parameters
getAccountTreeRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract GetAuthTokenResponse getAuthToken (GetAuthTokenRequest getAuthTokenRequest)

This method is used in the authorization process. You should call this method after the user has authorized themself on box.net site. Pass ticket that you get when called get_ticket method. On a successful result, method will return 'get_auth_token_ok' as status, auth_token to use in other method calls, and user struct which describes logged user. Request.

Parameters
getAuthTokenRequest Request object
Returns
  • getAuthTokenResponse response object
Throws
IOException io exception
BoxException box exception

public abstract GetFileInfoResponse getFileInfo (GetFileInfoRequest getFileInfoRequest)

This method gets file info. 'file_id' param should contain valid if of user file. On successful a result, you will receive status 's_get_file_info' and file info in 'info'. If the result wasn't successful, status field can be: e_access_denied.

Parameters
getFileInfoRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract GetFriendsResponse getFriends (GetFriendsRequest getFriendsRequest)

This method is used to retrieve a list of freinds. 'params' is an array of the string where you can set additional parameters, which are: nozip - do not zip tree xml. On a successful result you will receive 's_get_friends' as the status and base64 encoded (and zipped) friends xml. Friends xml looks like this: ......

Parameters
getFriendsRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract GetTicketResponse getTicket (GetTicketRequest getTicketRequest)

This method is used in the authorization process.

Parameters
getTicketRequest Request object
Returns
  • getTicketResponse response object
Throws
IOException IO exception
BoxException box exception

public abstract LogoutResponse logout (LogoutRequest logoutRequest)

This method is used to logout a user. On successful logout method will return 'logout_ok' as status. If logout wasn't successful, then status filed can be: 'invalid_auth_token' when auth_token is invalid.

Parameters
logoutRequest Request object
Returns
  • LogoutResponse object
Throws
IOException io exception
BoxException box exception

public abstract MoveResponse move (MoveRequest moveRequest)

This method moves a file or folder to another folder. 'target' param can be either 'file' or 'folder' depending on what do you want to move, 'target_id' is the id of a file or folder to be moved, 'destination_id' is the destination folder id. On a successful result, status will be 's_move_node'. If the result wasn't successful, status field can be: 'e_move_node', 'not_logged_in', 'application_restricted'.

Parameters
moveRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract PrivateShareResponse privateShare (PrivateShareRequest privateShareRequest)

This method privately shares a file or folder with another user(s). 'target' param should be either 'file' or 'folder', 'target_id' is the id of the file or folder to be shared. 'emails' params is an array of emails of users' to share files with. if 'notify' param is true, then a notification email will be sent to users, 'message' param is a message to be included in the notification email. Note: currently only files can be shared privately. On a successful result, the status will be 'private_share_ok'. If the result wasn't successful, the status field can be: 'private_share_error', 'wrong_node', 'not_logged_in', 'application_restricted'.

Parameters
privateShareRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract PublicShareResponse publicShare (PublicShareRequest publicShareRequest)

This method publicly shares a file or folder. 'target' param should be either 'file' or 'folder', 'target_id' is id of the file or folder to be shared. 'password' param is to protect sharing with a password, 'emails' params is array of emails to notify about a new share, 'message' param is some message to be included in a notification email. On a successful result, the status will be 'share_ok' and 'public_name' param will be a unique identifier of a publicly shared file or folder. If the result wasn't successful, the status field can be: 'share_error', 'wrong_node', 'not_logged_in', 'application_restricted'.

Parameters
publicShareRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract PublicUnshareResponse publicUnshare (PublicUnshareRequest publicUnshareRequest)

This method unshares a shared file or folder. 'target' param shoud be either 'file' or 'folder', 'target_id' is id of a file or folder to be unshared. On a successful result, the status will be 'unshare_ok'. If the result wasn't successful, the status field can be: 'unshare_error', 'wrong_node', 'not_logged_in', 'application_restricted'.

Parameters
publicUnshareRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract RegisterNewUserResponse registerNewUser (RegisterNewUserRequest registerNewUserRequest)

This method is used to register a user. Upon a successful registration, the status param will be 'successful_register'. If registration wasn't successful, status field can be: 'e_register', 'email_invalid', 'email_already_registered', 'application_restricted'.

Parameters
registerNewUserRequest Request object
Returns
  • response object
Throws
IOException io exception
BoxException box exception

public abstract RenameResponse rename (RenameRequest renameRequest)

This method renames a file or folder. 'target' param can be either 'file' or 'folder' depending on what you want to rename, 'target_id' is the id of a file or folder to be renamed, 'new_name' is the new name for a file or folder. On a successful result, status will be 's_rename_node'. If result wasn't successful, stat's field can be: 'e_rename_node', 'not_logged_in', 'application_restricted'.

Parameters
renameRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract RequestFriendsResponse requestFriends (RequestFriendsRequest requestFriendsRequest)

This method requests new friends to be added to your network. 'emails' - array of emails. 'message' - text message that you want to send to freinds. 'params' is an array of string where you can set additional parameters, which are: box_auto_subscribe - subscribe to public boxes of inveted users. no_email - don't send emails to invited users. On a successful result, you will receive status 's_request_friends'. If the result wasn't successful, status field can be: e_request_friends.

Parameters
requestFriendsRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract SetDescriptionResponse setDescription (SetDescriptionRequest setDescriptionRequest)

This method sets a description to a file or folder. 'target' can be a 'file' or 'folder', 'target_id' - id of file or folder, description - string that should be set as description. On successful a result, you will receive status 's_set_description'. If the result wasn't successful, status field can be: e_set_description.

Parameters
setDescriptionRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract UploadResponse upload (UploadRequest uploadRequest)

upload files.

Parameters
uploadRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception

public abstract VerifyRegistrationEmailResponse verifyRegistrationEmail (VerifyRegistrationEmailRequest verifyRegistrationEmailRequest)

This method is used to verify user registration email . Upon a not used and right registration email, the status param will be 'email_ok'. Else status field can be: 'email_invalid', 'email_already_registered', 'application_restricted'.

Parameters
verifyRegistrationEmailRequest Request object
Returns
  • response object
Throws
IOException IO exception
BoxException box exception