PeopleAggregator API: method peopleaggregator.newGroup

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

Method: peopleaggregator.newGroup

Create a group

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
An authentication token.
Example: 123576abcdef6572134

name

Type: string
Group name
Example: PeepAgg test group

category

Type: string
Category ID for this group
Example: cat:1

tags

Type: string
Comma-separated list of tags applying to this group
Example: peepagg, testing, hello

description

Type: string
Detailed description of the group
Example: A group for all PA testers

image

Type: string
URL of an image of/for the group
Example: http://example.org/mygroup.jpg

accessType

Type: enum
Whether the group is public or members-only
Allowed values: public, members
Example: public

registrationType

Type: enum
Who can register
Allowed values: open, moderated, invite
Example: open

moderationType

Type: enum
Show content immediately or require moderation?
Allowed values: direct, moderated
Example: direct

Return value (see also Exceptions)

Type: hash

Attributes:

success

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

id

Type: string
ID of the created group
Example: group:1234

Example REST (XML) request

Request

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

authToken=123576abcdef6572134&category=cat%3A1®istrationType=open&description=A+group+for+all+PA+testers&tags=peepagg%2C+testing%2C+hello&image=http%3A%2F%2Fexample.org%2Fmygroup.jpg&accessType=public&moderationType=direct&name=PeepAgg+test+group

Response

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

<response>
 <id>group:1234</id>
 <success>true</success>
</response>

Example REST (JSON) request

Request

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

authToken=123576abcdef6572134&category=cat%3A1®istrationType=open&description=A+group+for+all+PA+testers&tags=peepagg%2C+testing%2C+hello&image=http%3A%2F%2Fexample.org%2Fmygroup.jpg&accessType=public&moderationType=direct&name=PeepAgg+test+group

Response

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

{"id": "group:1234", "success": true}

Example XML-RPC call

Request

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

<?xml version='1.0'?>
 <methodCall>
  <methodName>peopleaggregator.newGroup</methodName>
  <params>
   <param>
    <value><struct>
     <member>
      <name>authToken</name>
      <value><string>123576abcdef6572134</string></value>
     </member>
     <member>
      <name>category</name>
      <value><string>cat:1</string></value>
     </member>
     <member>
      <name>registrationType</name>
      <value><string>open</string></value>
     </member>
     <member>
      <name>description</name>
      <value><string>A group for all PA testers</string></value>
     </member>
     <member>
      <name>tags</name>
      <value><string>peepagg, testing, hello</string></value>
     </member>
     <member>
      <name>image</name>
      <value><string>http://example.org/mygroup.jpg</string></value>
     </member>
     <member>
      <name>accessType</name>
      <value><string>public</string></value>
     </member>
     <member>
      <name>moderationType</name>
      <value><string>direct</string></value>
     </member>
     <member>
      <name>name</name>
      <value><string>PeepAgg test group</string></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodCall>
 

Response

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

<?xml version='1.0'?>
 <methodResponse>
  <params>
   <param>
    <value><struct>
     <member>
      <name>id</name>
      <value><string>group:1234</string></value>
     </member>
     <member>
      <name>success</name>
      <value><boolean>1</boolean></value>
     </member>
    </struct></value>
   </param>
  </params>
 </methodResponse>