PeopleAggregator API: method peopleaggregator.newUser

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

Method: peopleaggregator.newUser

Creates a new user. Note that this method has an unusual authentication system; it requires the system admin password. This is because it's not meant to be completely public; it's for system integration use, if you want to separately register users.

Arguments (see also Authentication)

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

adminPassword

Type: string
The admin password from local_config.php
Example: asjkdghf

homeNetwork

Type: string
The home network of the new user
Example: randomnetwork
Default: default

login

Type: string
The user's login name
Example: phil

firstName

Type: string
None
Example: Phillip

lastName

Type: string
None
Example: Pearson

password

Type: string
None
Example: foobar

email

Type: string
None
Example: phil@example.com

Return value (see also Exceptions)

Type: hash

Attributes:

success

Type: boolean
true if the user has successfully been created, false on failure.
Example: True

msg

Type: string
Detailed response information
Example: User phil created successfully

id

Type: string
ID of the new user
Example: user:432

Example REST (XML) request

Request

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

firstName=Phillip&adminPassword=asjkdghf&lastName=Pearson&login=phil&password=foobar&email=phil%40example.com&homeNetwork=randomnetwork

Response

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

<response>
 <msg>User phil created successfully</msg>
 <id>user:432</id>
 <success>true</success>
</response>

Example REST (JSON) request

Request

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

firstName=Phillip&adminPassword=asjkdghf&lastName=Pearson&login=phil&password=foobar&email=phil%40example.com&homeNetwork=randomnetwork

Response

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

{"msg": "User phil created successfully", "id": "user:432", "success": true}

Example XML-RPC call

Request

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

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.newUser</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>firstName</name>
      <value><string>Phillip</string></value>
     </member>
     <member>
      <name>adminPassword</name>
      <value><string>asjkdghf</string></value>
     </member>
     <member>
      <name>lastName</name>
      <value><string>Pearson</string></value>
     </member>
     <member>
      <name>login</name>
      <value><string>phil</string></value>
     </member>
     <member>
      <name>password</name>
      <value><string>foobar</string></value>
     </member>
     <member>
      <name>email</name>
      <value><string>phil@example.com</string></value>
     </member>
     <member>
      <name>homeNetwork</name>
      <value><string>randomnetwork</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

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

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>msg</name>
      <value><string>User phil created successfully</string></value>
     </member>
     <member>
      <name>id</name>
      <value><string>user:432</string></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>