User Activity
Tracking user activity when users perform actions on posts or comments. The API tracks the following actions:
Reactions to the post
Comments to the post
Reactions to the comment
Replies to the comment
Remove reactions or comments
API Reference
Retrieve activities of user's actions
GET
https://beta.amity.services/user-activities
Query Parameters
limit
Number
Specify the maximum number of responses you would like to retrieve, with a limit of 50.
createdAt
String
(Pagination purpose) createdAt will be provided by start key in the response.
networkId_userId
String
(Pagination purpose) networkId_userId will be provided by start key in the response.
Headers
Authorization*
String
Bearer {accessToken}
(accessToken is retrieved from Amity SDK)
{
"data": [
{
"createdAt": "string",
"networkId_userId": "string",
"targetId": "postA",
"targetType": "post",
"objectId": "commentX",
"objectType" : "comment",
"parentType" : "post",
"parentId" : "postA"
},
{
"createdAt": "string",
"networkId_userId": "string",
"targetId": "postA",
"targetType": "post",
"objectId": "reactionX",
"objectType" : "reaction_like",
"parentType" : "post",
"parentId" : "postA"
},
{
"createdAt": "string",
"networkId_userId": "string",
"targetId": "commentX",
"targetType": "comment",
"objectId": "commentY",
"objectType" : "comment",
"parentType" : "post",
"parentId" : "postA"
},
{
"createdAt": "string",
"networkId_userId": "string",
"targetId": "commentX",
"targetType": "comment",
"objectId": "reactionY",
"objectType" : "reaction_like",
"parentType" : "post",
"parentId" : "postA"
},
...
],
"start": {
"createdAt": "string",
"networkId_userId": "string"
}
}
Example curl
curl --location --request GET 'https://beta.amity.services/user-activities?
networkId_userId=<networkId_userId>&createdAt=<createdAt>&limit=10' \
--header 'Authorization: Bearer <ACCESSTOKEN>'
Scenario
The following table shows the supported scenarios and user actions that are recorded in the User Activity Record
User reacted to Post A
Post A
reaction_<type>
Post A
User commented to Post A
Post A
comment
Post A
User reacted to Comment A under Post A
Comment A
reaction_<type>
Post A
User reacted to Comment B under Post B
Comment B
reaction_<type>
Post B
User commented to Comment B under Post B
Comment B
comment
Post B
Last updated
Was this helpful?