PeopleAggregator API: method peopleaggregator.login

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

Method: peopleaggregator.login

Given a user name and password, returns an authentication token (suitable for passing as the authToken parameter to many methods).

Arguments (see also Authentication)

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

login

Type: string
User login name
Example: marc

password

Type: string
User password
Example: marcspassword

Return value (see also Exceptions)

Type: hash

Attributes:

success

Type: boolean
True on success, false on failure.
Example: True

authToken

Type: string
An authentication token.
Example: 123576abcdef6572134

tokenLifetime

Type: int
The number of seconds for which the authentication token will be valid.
Example: 86400

Example REST (XML) request

Request

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

login=marc&password=marcspassword

Response

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

<response>
 <authToken>123576abcdef6572134</authToken>
 <success>true</success>
 <tokenLifetime>86400</tokenLifetime>
</response>

Example REST (JSON) request

Request

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

login=marc&password=marcspassword

Response

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

{"authToken": "123576abcdef6572134", "success": true, "tokenLifetime": 86400}

Example XML-RPC call

Request

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

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.login</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>login</name>
      <value><string>marc</string></value>
     </member>
     <member>
      <name>password</name>
      <value><string>marcspassword</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

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

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>authToken</name>
      <value><string>123576abcdef6572134</string></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
     <member>
      <name>tokenLifetime</name>
      <value><int>86400</int></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>