Fetching like/comment details and posting comments on actions

Many times, we would want to track virality or post comments for a particular action, listing some of them below:

  1. When we have sent out an announcement and we want to track the virality of the announcement daily through API, meaning how many people have liked/commented on the post and what are the comments.
  2. When someone has given a Kudos and we want to programmatically comment on the post.

All these can be achieved by the content query and content creation APIs that Kaizala provides. We are going to discuss about them below.

Content Query APIs for monitoring reactions

Below is the API for getting the likes and comments summary for an action instance sent to a group:

Figure 1: Rest API to get a summary for likes and comments for an action instance

However, instead of a summary, we might need to dig deeper to understand who liked our posts or commented on our post. Below are the REST APIs for the same.

For drilling down on likes on a post:

Figure 2: Rest API to get details of likes for an action instance

For drilling down on comments on a post:

Figure 3: Rest API to get details of comments for an action instance

Content Creation APIs for posting reactions

Sometimes, there might be a need to post a comment on a particular post programmatically. For achieving this, Kaizala provides a POST API as described below:

Figure 4: Rest API for posting a comment on an action instance

Note:

In all the API definitions above, elements in curly / squiggly brackets need to be replaced as follows:

  • endpoint-url is present in the response to generate accessToken call.
  • Test-group-id is the id of the Group on which you want to send the reminder.
  • reference-id is the id of the action (survey / poll / custom action, etc.) that you have sent. While sending an action, you get an actionId and referenceId (screenshot shows the one to pick)
Figure 5: API response when an action is posted via API

Thank you for reading, hope it was helpful. If you have any comments / feedback, please let us know by commenting on this post. If you have any new REST API requirement, please reach out to kaizaladev@microsoft.com with your scenario.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s