ApiFunction_request_friends

Page history last edited by jeremy@... 1 wk ago

request_friends

 



Description

 

This method requests new friends to be added to the user's network.

 

 

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.
message string An message to be included in a notification email.
emails ArrayOfString An array of emails for which to notify users about the newly shared file or folder.
params ArrayOfString

Allows you to set additional, optional parameters:

  • 'box_auto_subcsribe' - Subscribe to the public boxes of invited users.
  • 'no_email' - Do not send emails to the invited users.

 

Output parameters:

 

Name Type Description
status string

If the operation was successful, the status parameter will be 's_request_friends'.

If the operation was not successful, the status field can be:

  • 'not_logged_in' - The user is not logged into your application.  Your authentication_token is not valid.
  • 'application_restricted'- You provided an invalid api_key, or the api_key is restricted from calling this function.
  • 'e_request_friends' - For all other errors.

 

 

REST

 

Request

 

https://www.box.net/api/1.0/rest?action=request_friends&api_key=rrc1d3n4b53tt6b2vh1il6tdtrsxov3v&auth_token=i4od3dv74uvdder7ng8vn5vbu90clu4t&emails[]=email1%40example.com&emails[]=email2%40example.com&message=123&params[]=auto_subscribe&params[]=no_email

 

 

Response

 

<?xml version='1.0' encoding='UTF-8' ?>
<response>
<status>s_request_friends</status>
</response>

SOAP

 

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>

 

XML

 

Request

 

<?xml version='1.0' encoding='UTF-8' ?>
<request>
<action>request_friends</action>
<api_key>rrc1d3n4b53tt6b2vh1il6tdtrsxov3v</api_key>
<auth_token>l9zk4uob1pvlaj4h75z272nq1kgds19c</auth_token>
<emails>
<item>email1@example.com</item>
<item>email2@example.com</item>
</emails>
<message>123</message>
<params>
<item>auto_subscribe</item>
</params>
</request>

 

Response

 

<?xml version='1.0' encoding='UTF-8' ?>
<response>
<status>s_request_friends</status>
</response>

 


 

Need additional assistance? Please feel free to Contact us