You can use this API request to retrieve a paged list of FollowRelation (users) that are following a Node.
/services/v2/node/[nodeId]/followers.json
You can use the following parameters in your retrieve node followers list request:
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 as 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 as true, the system returns a list of "FollowRelation*. Each FollowRelation entry models a social relation between a following user and the followed node.
When the active parameter is set as true (the default setting), the system only retrieves 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/node.json?includeOnly=id,name) to the AnswerHub REST API.
We added this request in version 1.6.3.
Sample Request
A GET retrieve node followers list request for a node (nodeId: 473) 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/node/473/followers.json"
Sample Response
{
"name": "",
"sort": "",
"page": 0,
"pageSize": 35,
"pageCount": 1,
"listCount": 2,
"totalCount": 2,
"list": [
{
"id": 7,
"type": "user",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1549308072000,
"username": "dzone",
"slug": "dzone",
"gold": 0,
"silver": 0,
"bronze": 2,
"reputation": 54,
"moderator": false,
"superuser": true,
"avatar": "http://apidocs.cloud.answerhub.com/users/7/photo/view.html",
"postCount": 10,
"followerCount": 0,
"followCount": 0,
"userFollowCount": 0,
"active": true,
"suspended": false,
"deactivated": false,
"groups": [
{
"id": "5",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066163000,
"name": "Super Users"
},
{
"id": "6",
"creationDate": 1542778947000,
"creationDateFormatted": "11/21/2018 05:42 AM",
"modificationDate": 1547066174000,
"name": "Network Administrators"
}
]
},
{
"id": 11,
"type": "user",
"creationDate": 1545231253000,
"creationDateFormatted": "12/19/2018 02:54 PM",
"modificationDate": 1549059427000,
"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"
}
]
}
]
}