You can use this API request to retrieve a paged list of the groups that have been created on your AnswerHub site.
/services/v2/group.json
You can use the following parameters in your retrieve group list request:
Paging and Sorting: page, pageSize, sort
projection: include, exclude, includeOnly
Other options: wrap, v1
Permissions & Notes:
You must have the Edit users and groups permission under Site Administration Roles in the Advanced Editor.
You can use the sort parameter to specify which of the sorting and ordering criteria you want used.
- An invalid sorting name will cause the request to reset to the default criteria.
With the includeOnly parameter set to id and name (/services/v2/group.json?includeOnly=id,name) to the AnswerHub REST API.
We added this request in version 1.6.3.
Sample Request
A GET retrieve group list request sent to https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub/test123) would look like this:
curl
-u answerhub:test123
-H "Accept: application/json"
-H "Content-type: application/json"
-X GET "https://apidocs.cloud.answerhub.com/services/v2/group.json"
Sample Responses
Successful Response
{
"name": "",
"sort": "",
"page": 1,
"pageSize": 10,
"pageCount": 1,
"listCount": 7,
"totalCount": 7,
"list": [
{
"id": 98,
"type": "group",
"creationDate": 1549297120000,
"creationDateFormatted": "02/04/2019 04:18 PM",
"modificationDate": 1549297120000,
"name": "Marketing",
"description": "Marketing Dept."
},
{
"id": 95,
"type": "group",
"creationDate": 1547821117000,
"creationDateFormatted": "01/18/2019 02:18 PM",
"modificationDate": 1548971848000,
"name": "Test Group",
"description": "Standard Users"
},
{
"id": 6,
"type": "group",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066174000,
"name": "Network Administrators"
},
{
"id": 5,
"type": "group",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066163000,
"name": "Super Users"
},
{
"id": 4,
"type": "group",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1542778947000,
"name": "Moderators"
},
{
"id": 3,
"type": "group",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066915000,
"name": "Users"
},
{
"id": 1,
"type": "group",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1542778947000,
"name": "Anonymous"
}
]
}
Error Response
{
"errors": {
"message": "You don't have permission to do this action.<br>Please login as another user"
}
}