Groups

An agent is a member of one or more groups.

Show

GET /groups/#{id}.xml
Returns a single group.

Response

Status: 200

<group>
  <id>2</id>
  <is-active>true</is-active>
  <name>Support</name>
</group>

List All

GET /groups.xml
Return a list of all groups, with group members nested within each group.

Response

Status: 200

<groups type="array" count="19">
  <group>
    <created-at type="datetime" nil="true"></created-at>
    <id type="integer">1</id>
    <is-active type="boolean">true</is-active>
    <name>1. Level Support</name>
    <updated-at type="datetime">2009-05-13T00:07:08-07:00</updated-at>
  </group>
  <group>
    ...
  </group>
  ...
</groups>

Create

POST /groups.xml
Creates a new group.

Request

<group>
  <name>Hardware</name>
  <agents type='array'>
    <agent>43</agent>
  </agents>
</group>

Response

Status: 201
Location: {new-group-id}.xml

Adds a group with one agent as member.

Update

PUT /groups/#{id}.xml
Updates an existing group with new details from the submitted XML.

Request

<group>
  <name>Hardware and ICP</name>
  <agents type='array'>
    <agent>43</agent>
    <agent>67</agent>
  </agents>
</group>

Note that if you do not submit an agents array, no agents get unassigned from the group. If you submit an empty array, all agents get removed from the group:

<group>
  <name>The now empty group</name>
  <agents type='array'></agents>
</group>

Response

Status: 200

Updates the group and sets two users to be a member of this group. Omit the <agents> part, if you do not wish to change the groups’ membership status.

Destroy

DELETE /groups/#{id}.xml
Destroys the group at the referenced URL.

The group is not actually deleted from the system, but is set inactive and can no longer be assigned.

Response

Status: 200

Members of a group

GET /groups/#{id}/users.xml
Get a list of the members of a group. This endpoint supports pagination of the users. For more information about the format of the users list see the Users API.