You can use this API request to retrieve analytics related to users' activities on the AnswerHub platform.
/services/v2/analytics/user.json
Permissions & Notes:
You must have the View analytics permission under Site Administration Roles in the Advanced Editor.
If you use both the fromDate and toDate parameters, the request will be for all information between those dates.
We added this request in version 1.6.3.
You can use the following parameters in your retrieve user activity analytics request:
Analytics Common: period, rate, fromDate, toDate
Analytics Action: activity, histogram
The system considers the following action types, user activities, for the purpose of this request:
Action | Verb (Type Name) | Description |
---|---|---|
AwardAction | awarded | A badge was awarded to a user. |
SuspendUserAction | suspended | Either a moderator or administrator suspended a user (usually for violating site use policy). |
UserJoinsAction | joined | A new user registered in the system and the system created a new account for them. |
Sample Request
A GET retrieve user activity analytics 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/analytics/user.json?fromDate=1/14/19&toDate=1/15/19"
Sample Response
Successful Response:
- HTTP Status 200 - OK
{
"actionsAnalytics": {
"actions": [
{
"type": "UserJoinsAction",
"verb": "Users Joined",
"count": 8
},
{
"type": "AwardAction",
"verb": "",
"count": 0
},
{
"type": "SuspendUserAction",
"verb": "Users Suspended",
"count": 2
}
]
}
}