PeopleAggregator API: method peopleaggregator.newUserRelation

Arguments | Return value | REST (XML) example | REST (JSON) example | XML-RPC example

Method: peopleaggregator.newUserRelation

Creates a new relationship. TODO: figure out how authentication will work here. This method will require authentication. We will get the login of the user creating the relation out of the auth info, so only the 'target' user need be specified in the args for this method.

Arguments (see also Authentication)

If calling by XML-RPC, note that this method takes a single struct as input, with the following keys:

authToken

Type: string
Authentication token for the user creating the relation (see authentication documentation for more info).
Example: 8976234abcdef1234

login

Type: string
Login name for the user at the other end of the relationship.
Example: marccanter

relation

Type: enum
The type of relationship.
Allowed values: havent met, acquaintance, relation, good relation, best relation
Example: relation

Return value (see also Exceptions)

Type: hash

Attributes:

success

Type: boolean
true if the relationship was successfully added, otherwise false.
Example: True

msg

Type: string
Success or failure detail.
Example: Relationship successfully added.

Example REST (XML) request

Request

POST /api/xml/peopleaggregator/newUserRelation HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 62

authToken=8976234abcdef1234&login=marccanter&relation=relation

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 155

<response>
 <msg>Relationship successfully added.</msg>
 <success>true</success>
</response>

Example REST (JSON) request

Request

POST /api/json/peopleaggregator/newUserRelation HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 62

authToken=8976234abcdef1234&login=marccanter&relation=relation

Response

HTTP/1.1 200 OK
Content-Type: application/x-javascript
Content-Length: 60

{"msg": "Relationship successfully added.", "success": true}

Example XML-RPC call

Request

POST /api/xmlrpc HTTP/1.1
Content-Type: text/xml
Content-Length: 1276

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.newUserRelation</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>authToken</name>
      <value><string>8976234abcdef1234</string></value>
     </member>
     <member>
      <name>login</name>
      <value><string>marccanter</string></value>
     </member>
     <member>
      <name>relation</name>
      <value><string>relation</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 924

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>msg</name>
      <value><string>Relationship successfully added.</string></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>