Get Group Members
This function returns the contacts that belong to a specific group.
Url:
https://ongair.im/api/v1/base/groups/{id}/members
Method:
GET
Params:
Field | Type | Mandatory | Format | Meaning |
---|---|---|---|---|
Id | Integer | Yes | Utf8 only encoded strings | The group id as returned from the group created call |
Response:
The server responds with a JSON message:
{
"id": 19,
"name": "test to add",
"contacts": [
{
"id": 1596,
"name": "254733171036",
"phone_number": "254733171036"
},
{
"id": 1597,
"name": "Kimenye Trevor",
"phone_number": "254705866564"
}
]
}
Field | Type | Meaning |
---|---|---|
id | Integer | The id of the group |
name | String | The name of the group |
Contacts | Array | An array of the members of the group. For each member, the id, name and phone_number are provided |
Error:
If there is an error, the server returns an error message and response code of 422.
{"error": "No group with id ‘2’ exists"}