add_to_mybox
Description
This method copies a file that publicly shared by another individual and into a user's a designated folder in the user's Box.
Input parameters:
| Name |
Type |
Description |
| api_key |
string |
The API key obtained when registering a project with OpenBox. |
| auth_token |
string |
The authentication token obtained when a user authenticates your application with Box. |
| file_id |
long |
The id of the file you wish to copy. |
| public_name |
string |
The unique public name of the shared file that you wish to copy. |
| folder_id |
long |
The folder_id of the folder to which you will copy the item. |
| tags |
ArrayOfString |
A List of tags to apply to the file when copied into the user's own folder. |
Output parameters:
| Name |
Type |
Description |
| status |
string |
If the operation was successful, the status will be 'add_to_my_box_ok'
If the operation was not successful, the status field can be:
- 'not_logged_in'
- 'application_restricted'
- 'addtomybox_error'
- 's_link_exists'
|
REST
Request
| https://www.box.net/api/1.0/rest?action=add_to_mybox&api_key=rrc1d3ntb53tt6b2vhail6rdtrsxov3v&auth_token=a3ysjive1k2x1q82bme6pxhngqh9ryrn&file_id=4940&public_name=&folder_id=0&tags[]= |
Response
<?xml version='1.0' encoding='UTF-8'?>
<response>
<status>addtomybox_ok</status>
</response>
SOAP
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>
XML
Request
<?xml version='1.0' encoding='UTF-8' ?>
<request>
<action>add_to_mybox</action>
<api_key>rrc1d3ntb53tt6b2vhail6rdtrsxov3v</api_key>
<auth_token>a3ysjive1k2x1q82bme6pxhngqh9ryrn</auth_token>
<file_id>4940</file_id>
<public_name></public_name>
<folder_id>0</folder_id>
<tags />
</request>
Response
<?xml version='1.0' encoding='UTF-8'?>
<response>
<status>addtomybox_ok</status>
</response>
Need additional assistance? Please feel free to Contact us