Resource Definitions:Groups/ID/Agents

From API Documentation

Jump to: navigation, search

The groups/ID/agents resource is a collection of all agent-to-group associations for the designated group, where "ID" is the group's group_id number.

Example URI: http://api.rezora.com/v1/groups/123/agents

Available methods are:

Contents

GET

Returns a list of agent-to-group associations for the designated group. Each association record includes the following fields:

  • usertogroup_id
  • user_id
  • group_id
  • usertogroup_timestamp

Example Responses

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<group_agents version="1.0">
 <group_agent>
  <usertogroup_id>1234567</usertogroup_id>
  <user_id>12345</user_id>
  <group_id>123</group_id>
  <usertogroup_timestamp>2010-07-21 16:46:01</usertogroup_timestamp>
 </group_agent>
 ...
</group_agents>

JSON Response

[
 {
  "usertogroup_id":"123456",
  "user_id":"12345",
  "group_id":"123",
  "usertogroup_timestamp":"2010-07-21 16:46:01"
 }
 ...
]

CSV Response

"usertogroup_id"|"user_id"|"group_id"|"usertogroup_timestamp"
"123456"|"12345"|"123"|"2010-07-21 16:46:01"
...

POST

Adds a new agent-to-group association for the designated group, and returns the new association ID. You may include the following fields (required fields marked with a red asterisk (*)):

  • user_id * - must be unique within this group

Example Request Data

XML Request

<?xml version="1.0" encoding="UTF-8"?>
<data>
 <user_id>12346</user_id>
</data>

JSON Request

{
 "data":{
  "user_id":"12346"
 }
}

TEXT Request

user_id=12346

Example Response Data

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<group_agents version="1.0">
 <group_agent>
  <usertogroup_id>123457</usertogroup_id>
 </group_agent>
</group_agents>

JSON Response

[
 {
  "usertogroup_id":"123457"
 }
]

CSV Response

"usertogroup_id"
"123457"

DELETE

Permanently removes ALL agent-to-group associations for the designated group, and returns a success code.

Example Response Data

XML Response

<?xml version="1.0" encoding="UTF-8"?>
<group_agents version="1.0">
 <group_agent>
  <status>200</status>
 </group_agent>
</group_agents>

JSON Response

[
 {
  "status":"200"
 }
]

CSV Response

"status"
"200"
Personal tools