You can use this API request to retrieve a paged list of FollowRelation (Users) that are following a topic.
/services/v2/topic/[topicId]/followers.json
You can use the following parameters in your retrieve topic followers request:
Specific: details, active
Paging and Sorting: page, pageSize, sort
Projection: include, exclude, includeOnly
Other options: wrap, v1
Permissions & Notes:
You must have the View users list permission under Anonymous Roles in the Advanced Editor.
When the details parameter is set to false (the default setting), the system only retrieves the follower information; the system does not return other relation information.
When the details parameter is set to true, the result is a list of FollowRelation. Each FollowRelation entry models a social relation between a following user and the followed topic.
When the active parameter is set as true (the default setting), the system only returns active relations.
When the active parameter is set as false, the system retrieves all relations, including those that are inactive.
With the includeOnly parameter set to id and name (/services/v2/topic.json?includeOnly=id,name) to the AnswerHub REST API.
We added this request in version 1.6.3.
Sample Request
A GET retrieve topic followers request to retrieve a list of followers of a specific topic (topicID: 127) 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/topic/127/followers.json" -v
Sample Response
Successful Response:
- HTTP Status 200 - OK
{
"name": "",
"sort": "",
"page": 0,
"pageSize": 35,
"pageCount": 1,
"listCount": 1,
"totalCount": 1,
"list": [
{
"id": 11,
"type": "user",
"creationDate": 1545231253000,
"creationDateFormatted": "12/19/2018 02:54 PM",
"modificationDate": 1549319679000,
"username": "answerhub",
"slug": "answerhub",
"gold": 0,
"silver": 0,
"bronze": 3,
"reputation": 2,
"moderator": false,
"superuser": false,
"avatar": "http://apidocs.cloud.answerhub.com/users/11/photo/view.html",
"postCount": 3,
"followerCount": 0,
"followCount": 0,
"userFollowCount": 0,
"active": true,
"suspended": false,
"deactivated": false,
"groups": [
{
"id": "3",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066915000,
"name": "Users"
}
]
}
]
}