|
Introduction
The SOAP Server Endpoint URL is http://box.net/api/1.0/soap
WSDL for box.net API Web Service available at http://box.net/api/1.0/soap?wsdl Data Types
SOAPUser
login: string,
email: string,
access_id: int,
user_id: int,
space_amount: long,
space_used: long
SOAPFolder
folder_id: long,
folder_name: string,
folder_type_id: long,
user_id: int,
path: string,
shared: int,
public_name: string,
password: string,
parent_folder_id: long
SOAPFileInfo
file_id:long,
file_name:string,
folder_id:long,
shared:int,
public_name:string,
size:long,
description:string,
sha1:string,
created:long,
updated:long
ArrayOfString Getting Started Guide
Getting Started with the Box.net APIYou can use the Box.net API to create applications and Web sites that integrate with Box.net. The Box.net API is a collection of Web services, which means that you can create Box Enabled applications using any modern programming language and operating system on any computer connected to the internet.Box Enabled applications can perform the following functions:
Every session with a Box Enabled application begins with user authentication, so we'll start there. For simplicity, we'll use the Box.net REST API, although you can also use the SOAP or XML Post APIs in your applications if you prefer -- the basic concepts are the same. Box.net API authentication provides a secure way for users to authenticate with Box.net without having to share their Box.net user name or password with you. This provides a consistent, safe experience for users and makes things easier on you (since you don't have to store user credentials). To obtain an authentication ticket, your application performs these steps:
If you're writing a web application, Box.net redirects the user to a page called the callback page. This is a page that resides on your site (you should have designated this page when you set up your application). The authentication appends a ticket variable to the end of this URL, passing you a request that looks like this: http://mysite.com/callback.php?ticket=ncnpjxt8bz7qkbn83c0qaf3ps0tr30tq &auth_token=98j243g9ijapwedfgjap8wj34gajw38wAfter the user has been redirected to your callback page, you should store the auth_token value securely, since every API call your application makes from this point forward will require the application key and the authentication token to be passed in along with the call. (The ticket parameter is deprecated and only provided for backwards compatibility.) For client applications, the user is shown a message instructing them to return to the application after they've authenticated. The application then calls get_auth_token with the ticket parameter to retrieve the authorization token. At this point, you'll probably either want to show the user the files in their Box or enable them to upload a file to their Box. To show a complete list of the user's files and folders, use the get_account_tree call. This call retrieves an XML document describing the entire contents of the user's box, including files and folders. You can also pass the ID of a folder as a parameter to this call, enabling your application to retrieve a subset of the tree structure. To upload a file, your application performs an HTTP POST using a URL of the form: http://upload.box.net/api/upload/<auth_token>/<folder_id>At the time you upload a file using HTTP POST, you can also specify whether you want the file to be publicly sharable (as described in the Upload and Download reference documentation). You can also share a file after it's been uploaded using the public_share API if you prefer. Authentication
Box.net authenticationTo authenticate users you should follow these steps:
get_ticket
input parameters:
api_key: string
output parameters:
status: string,
ticket: string
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet"
xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<tns:get_ticket>
<api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key>
</tns:get_ticket>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:get_ticketResponse>
<status xsi:type="xsd:string">get_ticket_ok</status>
<ticket xsi:type="xsd:string">819f55922d47097715b723218176a3a5</ticket>
</ns4:get_ticketResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
get_auth_token
input parameters:
api_key: string,
ticket: string,
output parameters:
status: string,
auth_token: string,
user: SOAPUser
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet"
xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:get_auth_token>
<api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key>
<ticket xsi:type="xsd:string">bxquuv025arztljze2n438md9zef95e8</ticket>
</tns:get_auth_token>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:get_auth_tokenResponse>
<status xsi:type="xsd:string">get_auth_token_ok</status>
<auth_token xsi:type="xsd:string">819f55922d47097715b723218176a3a5</auth_token>
<user xsi:type="ns4:SOAPUser">
<login xsi:type="xsd:string">login@email.com</login>
<email xsi:type="xsd:string">login@email.com</email>
<access_id xsi:type="xsd:int">453</access_id>
<user_id xsi:type="xsd:int">453</user_id>
<space_amount xsi:type="xsd:long">2147483648</space_amount>
<space_used xsi:type="xsd:long">49927894</space_used>
</user>
</ns4:get_auth_tokenResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
authorization
input parameters:
api_key: string,
login: string,
password: string,
method: string
output parameters:
status: string,
auth_token: string,
user: SOAPUser
On successful authorization method will return 'logged' as status, sid is session id to use in other method calls, and SOAPUser which describes logged user. If authorization wasn't successful, then status filed can be: 'invalid_login' when login or password is incorrect 'application_restricted' if you use an incorrect or restricted API key. Other fields will be empty. Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet"
xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:authorization>
<api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key>
<login xsi:type="xsd:string">login@email@com</login>
<password xsi:type="xsd:string">password</password>
<method xsi:type="xsd:string" />
</tns:authorization>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:authorizationResponse>
<status xsi:ty'e="xsd:string">logged</status>
<auth_token xsi:type="xsd:string">819f55922d47097715b723218176a3a5</auth_token>
<user xsi:type="ns4:SOAPUser">
<login xsi:type="xsd:string">login@email.com</login>
<email xsi:type="xsd:string">login@email.com</email>
<access_id xsi:type="xsd:int">453</access_id>
<user_id xsi:type="xsd:int">453</user_id>
<space_amount xsi:type="xsd:long">2147483648</space_amount>
<space_used xsi:type="xsd:long">49927894</space_used>
</user>
</ns4:authorizationResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
logout
input parameters:
api_key: string,
sid: string
output parameters:
status: string,
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. Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:logout> <api_key xsi:type="xsd:string">3cdu8ivll9t1y6lz2m416xn6xstymzgg</api_key> <sid xsi:type="xsd:string">tuxotd3sqdbao2c7i5a7u457371zlqzd</sid></ns4:logout> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:logoutResponse> <status xsi:type="xsd:string">logout_ok</status></ns4:logoutResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> register_new_user
input parameters:
api_key: string,
login: string,
password: string
output parameters:
status: string,
sid: string,
user: SOAPUser
If registration wasn't successful, status field can be: 'e_register', 'email_invalid', 'email_already_registered', 'application_restricted'. Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:register_new_user>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<login xsi:type="xsd:string">tapi@email.com</login>
<password xsi:type="xsd:string">password</password>
</tns:register_new_user>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:register_new_userResponse>
<status xsi:type="xsd:string">successfu'_register</status>
<sid xsi:type="xsd:string">70608aca552d69d475e48ec602119d4a</sid>
<user xsi:type="ns4:SOAPUser">
<login xsi:type="xsd:string">newuser@email.com</login>
<email xsi:type="xsd:string">newuser@email.com</email>
<access_id xsi:type="xsd:int" xsi:nil="true"/>
<user_id xsi:type="xsd:int">398376</user_id>
<space_amount xsi:type="xsd:long">1073741824</space_amount>
<space_used xsi:type="xsd:long" xsi:nil="true"/>
</user>
</ns4:register_new_userResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
register_paid_user
input parameters: api_key: string, login: string, password: string, name: string, plan: string, period: string, credit_card_first_name: string, credit_card_last_name: string, credit_card_street_address: string, credit_card_zip: string, credit_card_country: string, credit_card_number: string, credit_card_cvv: string, credit_card_exp_date: string output parameters: status: string, sid: string, user: SOAPUser If registration wasn't successful, status field can be: 'e_register', 'email_invalid', 'email_already_registered', 'credit_card_fields_error', 'wrong_billing_plan', 'wrong_billing_period', 'billing_error', 'application_restricted'. Request<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <tns:register_paid_user> <api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key> <login xsi:type="xsd:string">johndoe@example.com</login> <password xsi:type="xsd:string">password</password> <name xsi:type="xsd:string">John Doe</name> <plan xsi:type="xsd:string">Business</plan> <period xsi:type="xsd:string">Year</period> <credit_card_first_name xsi:type="xsd:string">John</credit_card_first_name> <credit_card_last_name xsi:type="xsd:string">Doe</credit_card_last_name> <credit_card_street_address xsi:type="xsd:string">100 Main Street</credit_card_street_address> <credit_card_zip xsi:type="xsd:string">12345</credit_card_zip> <credit_card_country xsi:type="xsd:string">US</credit_card_country> <credit_card_number xsi:type="xsd:string">0000000000000000</credit_card_number> <credit_card_cvv xsi:type="xsd:string">111</credit_card_cvv> <credit_card_exp_date xsi:type="xsd:string">1109</credit_card_exp_date> </tns:register_paid_user> </soap:Body> </soap:Envelope> Response<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <SOAP-ENV:Body> <ns4:register_paid_userResponse> <status xsi:type="xsd:string">successfu'_register</status> <sid xsi:type="xsd:string">70608aca552d69d475e48ec602119d4a</sid> <user xsi:type="ns4:SOAPUser"> <login xsi:type="xsd:string">johndoe@example.com</login> <email xsi:type="xsd:string">johndoe@example.com</email> <access_id xsi:type="xsd:int" xsi:nil="true"/> <user_id xsi:type="xsd:int">398376</user_id> <space_amount xsi:type="xsd:long">1073741824</space_amount> <space_used xsi:type="xsd:long" xsi:nil="true"/> </user> </ns4:register_paid_userResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> verify_registration_email
input parameters:
api_key: string,
login: string
output parameters:
status: string,
Else status field can be: 'email_invalid', 'email_already_registered', 'application_restricted'. Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:verify_registration_email>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<login xsi:type="xsd:string">tapi@email.com</login>
</tns:verify_registration_email>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:verify_registration_emailResponse>
<status xsi:type="xsd:string">email_ok</status>
</ns4:verify_registration_emailResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
get_account_tree
input parameters:
api_key: string,
sid: string,
folder_id: long,
params: ArrayOfString
output parameters:
status: string,
tree: base64Binary
'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)
<?xml version="1.0" ?>
<folder id="0" name="" shared="0">
<tags></tags>
<files></files>
<folders>
<folder id="4384" name="Incoming" shared="0">
<tags>
<tag id="34" />
</tags>
<files>
<file id="68736" file_name="cows.w3g" keyword="" shared="0" size="232386"
created="1129537520" updated="1129537520">
<tags>
</tags>
</file>
<file id="68737" file_name="silver.html" keyword="" shared="0" size="15805"
created="1129537520" updated="1129537520">
<tags>
<tag id="35" />
</tags>
</file>
</files>
</folder>
<folders>
</folder>
'not_logged_id', 'application_restricted', 'e_folder_id' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:get_account_tree>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">4628c8c9c4b86c22567e53d215ecdc79</sid>
<folder_id xsi:type="xsd:long">0</folder_id>
<params href="#id1" />
</tns:get_account_tree>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[0]" />
</soap:Body>
</soap:Envelope>
Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:get_account_treeResponse>
<status xsi:type="xsd:string">listing_ok</status>
<tree xsi:type="xsd:base64Binary">
PD94bWwgdmVyc2lvbj0iMS4wIj8+PGZvbGRlciBpZD0iMCIgbmFtZT0iIiBzaGFyZWQ9IiIgc2hhcmVkX2xpbms9IiIgP
jx0YWdzPjwvdGFncz48ZmlsZXM+PGZpbGUgaWQ9IjI3OTEiIGZpbGVfbmFtZT0iMS5naWYiIHNoYXJlZD0iMCIgY3JlYX
RlZD0iMTE1NzUzODcwOSIgdXBkYXRlZD0iMTE2MTU5MTMxNSIgc2l6ZT0iNTA1IiBzaGFyZWRfbGluaz0iIiAgPjx0YWd
zPjwvdGFncz48L2ZpbGU+PC9maWxlcz48L2ZvbGRlcj4=
</tree>
</ns4:get_account_treeResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope><br>
export_tags
input parameters:
api_key: string,
sid: string
output parameters:
status: string,
tag_xml: base64Binary,
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:
<?xml version="1.0"?>
<tags>
<tag id="37">
music
</tag>
<tag id="38">
mp3
</tag>
</tags>
not_logged_id, application_restricted Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet"
xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:export_tags>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">f3704d9358146e51f5819ea4d755b1c5</sid>
</tns:export_tags>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:export_tagsResponse>
<status xsi:type="xsd:string">export_tags_ok</status>
<tag_xml xsi:type="xsd:base64Binary">
PD94bWwgdmVyc2lvbj0iMS4wIj8+PHRhZ3M+PHRhZyBpZD0iMzciPnRhZzE8L3RhZz48dGFnIGlk
PSIzOCI+dGFnMjwvdGFnPjwvdGFncz4=
</tag_xml>
</ns4:export_tagsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
create_folder
input parameters:
api_key: string,
sid: string,
parent_id: long,
name: string,
share: long
output parameters:
status: string,
folder: SOAPFolder
'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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:create_folder>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<parent_id xsi:type="xsd:long">428</parent_id>
<name xsi:type="xsd:string">New Folder</name>
<share xsi:type="xsd:long">1</share>
</tns:create_folder>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:create_folderResponse>
<status xsi:type="xsd:string">create_ok</status>
<folder xsi:type="ns4:SOAPFolder">
<folder_id xsi:type="xsd:long">541</folder_id>
<folder_name xsi:type="xsd:string">New Folder</folder_name>
<folder_type_id xsi:type="xsd:long">0</folder_type_id>
<user_id xsi:type="xsd:int">453</user_id>
<path xsi:type="xsd:string">/12345wwv</path>
<shared xsi:type="xsd:int">0</shared>
<public_name xsi:type="xsd:string">gh23ghjj</public_name>
<password xsi:type="xsd:string"></password>
<parent_folder_id xsi:type="xsd:long">428</parent_folder_id>
</folder>
</ns4:create_folderResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
move
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long,
destination_id: long
output_parameters:
status: string
'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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:move>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3777</target_id>
<destination_id xsi:type="xsd:long">440</destination_id>
</tns:move>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:moveResponse>
<status xsi:type="xsd:string">s_move_node</status>
</ns4:moveResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
rename
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long,
new_name: string
output parameters:
status: string
'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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:rename>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3778</target_id>
<new_name xsi:type="xsd:string">4.jpg</new_name>
</tns:rename>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:renameResponse>
<status xsi:type="xsd:string">s_rename_node</status>
</ns4:renameResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
delete
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long
output parameters:
status: string
'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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:delete>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3695</target_id>
</tns:delete>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:deleteResponse>
<status xsi:type="xsd:string">s_delete_node</status>
</ns4:deleteResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public_share
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long,
password: string,
message: string,
emails: ArrayOfString,
output parameters:
status: string,
public_name: string
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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:public_share>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3778</target_id>
<password xsi:type="xsd:string">password</password>
<message xsi:type="xsd:string">hey</message>
<emails href="#id1" />
' </tns:public_share>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[2]">
<Item>notify1@email.com</Item>
<Item>notify2@email.com</Item>
</soapenc:Array>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:public_shareResponse>
<status xsi:type="xsd:string">share_ok</status>
<public_name xsi:type="xsd:string">a64ebam2dx</public_name>
</ns4:public_shareResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public_unshare
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long
output parameters:
status: string
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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:public_unshare>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3778</target_id>
</tns:public_unshare>
</soap:Body>
</soap:Envelope>
Response
<?x'l version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:public_unshareResponse>
<status xsi:type="xsd:string">unshare_ok</status>
</ns4:public_unshareResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
private_share
input parameters:
api_key: string,
sid: string,
target: string,
target_id: long,
emails: ArrayOfString,
message: string,
notify: boolean
output parameters:
status: string
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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:private_share>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<target xsi:type="xsd:string">file</target>
<target_id xsi:type="xsd:long">3687</target_id>
<emails href="#id1" />
<message xsi:type="xsd:string">message here</message>
<notify xsi:type="xsd:boolean">true</notify>
</tns:private_share>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[1]">
<Item>some@email.com</Item>
</soapenc:Array>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sch'mas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:private_shareResponse>
<status xsi:type="xsd:string">private_share_ok</status>
</ns4:private_shareResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
add_to_mybox
input parameters:
api_key: string,
sid: string,
file_id: long,
public_name: string,
folder_id: long,
tags: string
output parameters:
status: string
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' Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet" xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:add_to_mybox>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">baa8b089c5a635adc0baa68aa1c61bbe</sid>
<file_id xsi:type="xsd:long">0</file_id>
<public_name xsi:type="xsd:string">n3myhu0zif</public_name>
<folder_id xsi:type="xsd:long">541</folder_id>
<tags xsi:type="xsd:string" />
</tns:add_to_mybox>
</soap:Body>
</soap:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
<SOAP-ENV:Body>
<ns4:add_to_myboxResponse>
<status xsi:type="xsd:string">addtomybox_ok</status>
</ns4:add_to_myboxResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
add_to_tag
input parameters:
api_key: string,
sid: string,
tags: ArrayOfString,
target: string,
target_id: long
output parameters:
status: string
On successful a result, you will receive 'addtotag_ok'. If the result wasn't successful, status field can be: addtotag_error Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:boxnet"
xmlns:types="urn:boxnet/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:export_tags>
<api_key xsi:type="xsd:string">rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<sid xsi:type="xsd:string">f3704d9358146e51f5819ea4d755b1c5</sid>
</tns:export_tags>
</soap:Body>
</soap:Envelope>
Response<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:add_to_tagResponse> <status xsi:type="xsd:string">addtotag_ok</status></ns4:add_to_tagResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> get_file_info
input parameters:
api_key: string,
sid: string,
file_id: long
output parameters:
status: string,
info: SOAPFileInfo
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 Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:get_file_info> <api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key> <sid xsi:type="xsd:string">fibe48ppm8otd1bepli9cyjma6mrfoea</sid> <file_id xsi:type="xsd:int">224</file_id></ns4:get_file_info> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:get_file_infoResponse> <status xsi:type="xsd:string">s_get_file_info</status> <file xsi:type="ns4:SOAPFileInfo"> <file_id xsi:type="xsd:long">224</file_id> <file_name xsi:type="xsd:string">Box Press Release.doc</file_name> <folder_id xsi:type="xsd:long">0</folder_id> <shared xsi:type="xsd:int">0</shared> <public_name xsi:type="xsd:string"></public_name> <size xsi:type="xsd:long">22528</size> <description xsi:type="xsd:string"></description> <sha1 xsi:type="xsd:string">9a0bc49038c167151c544ac0b5fc9042335a41a3</sha1> <created xsi:type="xsd:long">1182159570</created> <updated xsi:type="xsd:long">1182159571</updated></file></ns4:get_file_infoResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> set_description
input parameters:
api_key: string,
sid: string,
target: string,
target_id: login,
description: string
output parameters:
status: string
On successful a result, you will receive status 's_set_description'. If the result wasn't successful, status field can be: e_set_description Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:set_description> <api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key> <sid xsi:type="xsd:string">1u5knz7ztli9z8zigepu8opvv0jna11c</sid> <target xsi:type="xsd:string">file</target> <target_id xsi:type="xsd:int">224</target_id> <description xsi:type="xsd:string">123</description></ns4:set_description> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:set_descriptionResponse> <status xsi:type="xsd:string">s_set_description</status></ns4:set_descriptionResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> get_friends
input parameters:
api_key: string,
sid: string,
params: ArrayOfString
output parameters:
status: string,
friends: base64Binary
'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:
<friends>
<friend>
<name>email2@example.com</name>
<email>email2@example.com</email>
<accepted>1</accepted>
<avatar_url>
http://box.net/index.php?rm=box_user_avatar&user_id=398396
&width=40&height=40&type=large
</avatar_url>
<boxes>
<box>
<id>15</id>
<url>http://box.net/p/email2</url>
<status>0</status>
</box>
</boxes>
<subscriptions>
<subscription>
<box_id>14</box_id>
<user_name>email3@example.com</user_name>
<url>http://box.net/p/email3</url>
<status>subscribed</status>
</subscription>
</subscriptions>
</friend>
</friends>
e_get_friends Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:get_friends> <api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key> <sid xsi:type="xsd:string">6tsncrgnlmbk06o8sfqnuydhqvm604rl</sid> <params xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">nozip</item></params></ns4:get_friends> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:get_friendsResponse>
<status xsi:type="xsd:string">s_get_friends</status>
<friends xsi:type="xsd:base64Binary">
<friends>
<friend>
<name>email2@example.com</name>
<email>email2@example.com</email>
<accepted>1</accepted>
<avatar_url>
http://box.net/index.php?rm=box_user_avatar&user_id=398396
&width=40&height=40&type=large
</avatar_url>
<boxes>
<box>
<id>15</id>
<url>http://box.net/p/email2</url>
<status>0</status>
</box>
</boxes>
<subscriptions>
<subscription>
<box_id>14</box_id>
<user_name>email3@example.com</user_name>
<url>http://box.net/p/email3</url>
<status>subscribed</status>
</subscription>
</subscriptions>
</friend>
</friends>
</friends>
</ns4:get_friendsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
request_friends
input parameters:
api_key: string,
sid: string,
emails: ArrayOfString,
message: string,
params: ArrayOfString
output parameters:
status: string
'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 Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:request_friends> <api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key> <sid xsi:type="xsd:string">5ru84g9ev7gcgzcejq5ocn258m3o4yry</sid> <emails xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[2]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">email1@example.com</item> <item xsi:type="xsd:string">email2@example.com</item></emails> <message xsi:type="xsd:string">123</message> <params xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">auto_subscribe</item></params></ns4:request_friends> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:request_friendsResponse> <status xsi:type="xsd:string">s_request_friends</status></ns4:request_friendsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> get_updates
input parameters:
api_key: string,
sid: string,
begin_timestamp: long,
params: ArrayOfString
output parameters:
status: string,
updates: base64Binary
'begin_timestamp' - the start date in unix timestamp of the range of updates you wish to retrieve. 'params' is array of string where you can set additional parameters, which are: nozip - do not zip tree xml. On successful result you will receive 's_get_updates' as status and base64 encoded(and zipped) updates xml. Updates xml looks like this:
<updates>
<update>
<name></name>
<message></message>
<updated>1180341648</updated>
<user_name>email1@example.xom</user_name>
<public_url>http://box.net/p/email1</public_url>
<files>
<file>
<name></name>
<size>293.5 KB</size>
<date>May 28, 2007</date>
<thumbnail>
http://dav1.box.net/large_thumb/2007-05-28/b711d51b95bd
888ada7a46999b3d2b70.jpg
</thumbnail>
</file>
</files>
</update>
</updates>
e_get_updates Request<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns4="urn:boxnet" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns4:get_updates> <api_key xsi:type="xsd:string">rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key> <sid xsi:type="xsd:string">zu3xji1ugflahk7hgk9dok6tiq8f7ho6</sid> <begin_timestamp xsi:type="xsd:int">0</begin_timestamp> <params xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[1]" SOAP-ENC:offset="[0]"> <item xsi:type="xsd:string">nozip</item></params></ns4:get_updates> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:boxnet"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns4:get_updatesResponse>
<status xsi:type="xsd:string">s_get_updates</status>
<updates xsi:type="xsd:base64Binary">
<updates>
<update>
<name></name>
<message></message>
<updated>1180341648</updated>
<user_name>email1@example.xom</user_name>
<public_url>http://box.net/p/email1</public_url>
<files>
<file>
<name></name>
<size>293.5 KB</size>
<date>May 28, 2007</date>
<thumbnail>
http://dav1.box.net/large_thumb/2007-05-28/b711d51b95bd
888ada7a46999b3d2b70.jpg
</thumbnail>
</file>
</files>
</update>
</updates>
</updates></ns4:get_updatesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Upload & Download
DownloadTo download a file, use a link like http://box.net/api/1.0/download/<auth_token>/<file_id>for example: http://box.net/api/1.0/download/0ef4e2b1be630554ffa4044c054b1954/542666 UploadTo upload a file, send HTTP POST request to http://upload.box.net/api/1.0/upload/<auth_token>/<folder_id>It is important that you upload to upload.box.net otherwise your upload will be rejected.
folder_id is the id of a folder in which the file will be uploaded.For public sharing of file set share, message and emails fields. HTML to perform an upload might look like the following: <form action="http://upload.box.net/api/1.0/upload/0ef4e2b1be630554ffa4044c054b1954/756" enctype="multipart/form-data" method="POST"> <input type="file" name="new_file1" /> <input type="file" name="new_file2" /> <input type="text" name="share" value="1" /> <input type="text" name="message" value="Hello" /> <input type="text" name="emails[]" value="test@domain.com" /> <input type="text" name="emails[]" value="test1@domain.com" /> <input type="submit" name="upload_files" value="Upload File" /> </form> <?xml version='1.0' encoding='UTF-8' ?> <response> <status>upload_ok</status> <files> <file file_name="read_me.txt" id="5996" folder_id="756" shared="0" public_name="" /> <file file_name="Rally.avi" error="filesize_limit_exceeded" /> </files> </response> 'upload_some_files_failed', 'not_logged_id', 'application_restricted' For files that wasn't upload error field can be: not_enough_free_space, filesize_limit_exceeded, access_denied Examples
Example files can be downloaded at http://www.box.net/public/dmro48bi1c
PHPTo access the box.net API from PHP you will need to download a SOAP client library for PHP.In our examples, we use PEAR SOAP Client/Server for PHP which is available at http://pear.php.net/package/SOAP. To run this example, you should register a project on http://enabled.box.net and get your API KEY. Copy this code to you web folder and setup "Call-back URL" to its url.
<?php
// Change it to a valid API KEY
$api_key = '';
// SOAP API endpoint
$server_url = 'http://box.net/';
require_once('SOAP/Client.php');
$soapclient = new SOAP_Client($server_url . 'api/1.0/soap');
$options = array('namespace' => 'urn:boxnet',
'trace' => 1);
if( !isset($_REQUEST['auth_token']))
{
// Authorizing
$ret = $soapclient->call('get_ticket',
$params = array('api_key' => $api_key),
$options);
if ($ret['status'] == 'get_ticket_ok')
{
$ticket = $ret['ticket'];
// Then user will be redirected to auth page
header("Location: " . $server_url . "api/1.0/auth/" . $ticket );
}
else
{
print "Get ticket error: ". $ret['status'];
print "<br></body></html>";
exit();
}
}
$auth_token = $_REQUEST['auth_token'];
// Getting account tree
$ret = $soapclient->call('get_account_tree',
$params = array('api_key' => $api_key,
'auth_token' => $auth_token,
'folder_id' => 0,
'params' => array(
//'nozip'
)),
$options);
if ($ret['status'] == 'listing_ok')
{
print "Get account tree ok..<br><br>";
$tree = $ret['tree'];
// here you can unzip tree and work with xml.
}
else
{
print "Get account tree error: " . $ret['status'];
print "<br>";
}
// Creating a folder
$ret = $soapclient->call('create_folder',
$params = array('api_key' => $api_key,
'auth_token' => $auth_token,
'parent_id' => 0,
'name' => 'New Folder1',
'share' => 1
),
$options);
if ($ret['status'] == 'create_ok')
{
$folder = $ret['folder'];
print "Created folder '" . $folder->folder_name . "' with id " . $folder->folder_id;
print "<br><br>";
}
elseif ($ret['status'] == 's_folder_exists')
{
print "Tried to create folder, but folder already exists<br><br>";
}
else
{
print "Create folder error: ". $ret['status'];
}
print "<br>\n";
?>
C#To compile this example, you should first generate XML Web Service proxy code using wsdl.exe utility from Microsoft© .NET Framework SDK.You can do it with the following command: wsdl.exe /namespace:Boxnetapi.net.box.api /o:generated.cs http://box.net/api/1.0/soap?wsdl
using System;
using Boxnetapi.net.box.api;
namespace Boxnetapi
{
class Program
{
[STAThread]
static void Main(string[] args)
{
boxnetService service = new boxnetService();
// Box.net SOAP API endpoint
string api_url = "http://box.net/api/1.0/";
service.Url = api_url + "soap";
// Change it to valid API KEY
string api_key = "";
// You should provide your box.net login and password
string login = "";
string password = "";
string auth_token = "";
// Signing in
SOAPUser user;
string ticket;
string status = service.get_ticket(api_key, out ticket);
if (status != "get_ticket_ok")
{
// some error happen
System.Console.WriteLine(status);
return;
}
string url = api_url + "auth/" + ticket;
// Open browser window to log in..
System.Diagnostics.Process.Start(url);
System.Console.ReadLine(); // Waiting until user logs in
status = service.get_auth_token(api_key, ticket, out auth_token, out user);
if (status =="get_auth_token_ok")
{
Console.WriteLine("Logged as {0}", user.login);
}
else
{
Console.WriteLine("Authorization error: {0}", status);
return;
}
Console.WriteLine();
// Getting account tree xml
byte[] tree;
status = service.get_account_tree(api_key, auth_token, 0, new string[]{"nozip"}, out tree);
if (status == "listing_ok")
{
string xml = System.Text.Encoding.ASCII.GetString(tree);
Console.WriteLine("---------------------------------------------------------------------");
Console.WriteLine(xml);
Console.WriteLine("---------------------------------------------------------------------");
}
else
{
Console.WriteLine("Get account tree error: {0}", status);
}
Console.WriteLine();
// Creating new folder
SOAPFolder folder;
status = service.create_folder(api_key, auth_token, 0, "New Folder", 0, out folder);
if (status == "create_ok")
{
Console.WriteLine("Created folder '{0}' with id {1}", folder.folder_name, folder.folder_id);
}
else if (status == "s_folder_exists")
{
Console.WriteLine("Folder already exists");
}
else
{
Console.WriteLine("Create folder error: {0}", status);
}
}
}
}
Need help? Contact us |
Sections
Introduction
Getting Started Guide
Authentication
get_ticket
get_auth_token
logout
register_new_user
verify_registration_email
get_account_tree
export_tags
create_folder
move
rename
delete
public_share
public_unshare
private_share
add_to_mybox
add_to_tag
get_file_info
set_description
get_friends
request_friends
Upload & Download
Examples
|
