Retrieve a List of Actions Performed by a User

You can use this API request to retrieve a list of actions performed by a user on your AnswerHub site.

/services/v2/user/[userId]/action.json

You can use the following parameters in your retrieve a list of actions performed by a user request:

Paging and Sorting: page, pageSize, sort
Projection: include, exclude, includeOnly
Other options: wrap, v1

🚧

Permissions & Notes:

  • You must have the View user's profile under the Anonymous Roles and View analytics permissions under Site Administration Roles in the Advanced Editor.

  • With the includeOnly parameter set to id and name (/services/v2/action.json?includeOnly=id,name) to the AnswerHub REST API.

  • We added this request in version 1.6.3.

Sample Request

A GET retrieve a list of actions performed by a user request for a user (userId: 96) 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/user/96/action.json"

Sample Response

Successful Response:

  • HTTP Status 200 - OK
{
    "name": "",
    "sort": "actionDate",
    "page": 1,
    "pageSize": 20,
    "pageCount": 1,
    "listCount": 3,
    "totalCount": 3,
    "list": [
        {
            "id": 984,
            "ip": "172.20.0.3",
            "user": {
                "id": 96,
                "username": "demo2",
                "reputation": 1
            },
            "actionDate": 1548346411000,
            "canceled": false,
            "extra": "1",
            "privateAction": false,
            "verb": "voted",
            "node": {
                "id": 819,
                "type": "idea",
                "creationDate": 1441108800000,
                "creationDateFormatted": "09/01/2015 12:00 PM",
                "title": "title of an idea",
                "body": "<div class=\"fr-view clearfix\">body of an idea</div>",
                "bodyAsHTML": "<div class=\"fr-view clearfix\">body of an idea</div>",
                "author": {
                    "id": 108,
                    "username": "admin",
                    "reputation": 61
                },
                "lastEditedAction": 979,
                "activeRevisionId": 823,
                "revisionIds": [
                    823
                ],
                "lastActiveUserId": 108,
                "lastActiveDate": 1441108800000,
                "attachments": [],
                "childrenIds": [],
                "commentIds": [],
                "marked": false,
                "topics": [
                    {
                        "id": 817,
                        "creationDate": 1548336293000,
                        "creationDateFormatted": "01/24/2019 01:24 PM",
                        "name": "idea1",
                        "author": {
                            "id": 108,
                            "username": "admin",
                            "reputation": 61
                        },
                        "usedCount": 1,
                        "getImmediateChildren": [],
                        "getParents": []
                    },
                    {
                        "id": 818,
                        "creationDate": 1548336293000,
                        "creationDateFormatted": "01/24/2019 01:24 PM",
                        "name": "idea2",
                        "author": {
                            "id": 108,
                            "username": "admin",
                            "reputation": 61
                        },
                        "usedCount": 1,
                        "getImmediateChildren": [],
                        "getParents": []
                    }
                ],
                "primaryContainerId": 11,
                "containerIds": [
                    7,
                    11
                ],
                "slug": "title-of-an-idea",
                "wiki": false,
                "score": 4,
                "depth": 0,
                "viewCount": 3,
                "upVoteCount": 4,
                "downVoteCount": 0,
                "nodeStates": []
            },
            "rootNode": {
                "id": 819,
                "type": "idea",
                "creationDate": 1441108800000,
                "creationDateFormatted": "09/01/2015 12:00 PM",
                "title": "title of an idea",
                "body": "<div class=\"fr-view clearfix\">body of an idea</div>",
                "bodyAsHTML": "<div class=\"fr-view clearfix\">body of an idea</div>",
                "author": {
                    "id": 108,
                    "username": "admin",
                    "reputation": 61
                },
                "lastEditedAction": 979,
                "activeRevisionId": 823,
                "revisionIds": [
                    823
                ],
                "lastActiveUserId": 108,
                "lastActiveDate": 1441108800000,
                "attachments": [],
                "childrenIds": [],
                "commentIds": [],
                "marked": false,
                "topics": [
                    {
                        "id": 817,
                        "creationDate": 1548336293000,
                        "creationDateFormatted": "01/24/2019 01:24 PM",
                        "name": "idea1",
                        "author": {
                            "id": 108,
                            "username": "admin",
                            "reputation": 61
                        },
                        "usedCount": 1,
                        "getImmediateChildren": [],
                        "getParents": []
                    },
                    {
                        "id": 818,
                        "creationDate": 1548336293000,
                        "creationDateFormatted": "01/24/2019 01:24 PM",
                        "name": "idea2",
                        "author": {
                            "id": 108,
                            "username": "admin",
                            "reputation": 61
                        },
                        "usedCount": 1,
                        "getImmediateChildren": [],
                        "getParents": []
                    }
                ],
                "primaryContainerId": 11,
                "containerIds": [
                    7,
                    11
                ],
                "slug": "title-of-an-idea",
                "wiki": false,
                "score": 4,
                "depth": 0,
                "viewCount": 3,
                "upVoteCount": 4,
                "downVoteCount": 0,
                "nodeStates": []
            },
            "topics": [
                {
                    "id": 817,
                    "creationDate": 1548336293000,
                    "creationDateFormatted": "01/24/2019 01:24 PM",
                    "name": "idea1",
                    "author": {
                        "id": 108,
                        "username": "admin",
                        "reputation": 61
                    },
                    "usedCount": 1,
                    "getImmediateChildren": [],
                    "getParents": []
                },
                {
                    "id": 818,
                    "creationDate": 1548336293000,
                    "creationDateFormatted": "01/24/2019 01:24 PM",
                    "name": "idea2",
                    "author": {
                        "id": 108,
                        "username": "admin",
                        "reputation": 61
                    },
                    "usedCount": 1,
                    "getImmediateChildren": [],
                    "getParents": []
                }
            ]
        },
        {
            "id": 967,
            "ip": "172.18.0.3",
            "user": {
                "id": 96,
                "username": "demo2",
                "reputation": 1
            },
            "actionDate": 1548344805000,
            "canceled": false,
            "privateAction": false,
            "verb": "joined",
            "topics": []
        },
        {
            "id": 981,
            "ip": "172.20.0.3",
            "user": {
                "id": 96,
                "username": "demo2",
                "reputation": 1
            },
            "realUser": {
                "id": 7,
                "username": "dzone",
                "reputation": 36
            },
            "actionDate": 1548344519000,
            "canceled": false,
            "privateAction": false,
            "verb": "joined",
            "topics": []
        }
    ]
}
Language
Authentication
Basic
base64
:
Click Try It! to start a request and see the response here!