Start a conversation

Retrieve Action Analytics

Overview

Accessing action analytics requires specific permissions and utilizes various parameters. This guide details the API endpoint, necessary permissions, parameters, and provides sample requests and responses.


Information

/services/v2/analytics/actions.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 action analytics request:

Analytics Common: period, rate, fromDate, toDate
Analytics Action: activity, histogram

We consider the following action types, action activities, for the purpose of this request:

Action Verb (Type Name) Description

QuestionViewAction

viewed

A user has viewed/visited a question.

VoteDownAction

voted

A node was down-voted.

VoteUpAction

voted

A node was up-voted.

Sample Request

A GET retrieve action analytics request sent to https://apidocs.cloud.answerhub.com using a human-readable Username/Password (answerhub/test123) would look like this:

  • cURL
curl 
-u answerhub:test123 
-H "Accept: application/json" 
-H "Content-type: application/json" 
-X GET "https://apidocs.cloud.answerhub.com/services/v2/analytics/actions.json"

Sample Response

  • Sample Formatted JSON Response
{
    "actions": [
        {
            "type": "NodeViewAction",
            "verb": "Viewed Posts",
            "count": 6
        },
        {
            "type": "VoteDownAction",
            "verb": "Down Votes",
            "count": 0
        },
        {
            "type": "VoteUpAction",
            "verb": "Up Votes",
            "count": 0
        }
    ]
}
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments