Comments API Overview
Post, reply, get, and delete comments on a social post
The Comments endpoints allow your users to post, reply, retrieve, and delete comments on their posts. There are four types of comments IDs: Ayrshare Post ID, Social Post ID, Ayrshare Comment ID, and Social Comment ID. Each of these IDs are used for different purposes.
Comment ID Types
Comments with Ayrshare Post ID
The typical flow is when you publish a post via Ayrshare, you get the Ayrshare Post ID. You can then use this Ayrshare Post ID to manage comments on that post.
Supported platforms: Facebook Pages, Instagram, LinkedIn, Reddit, TikTok, Twitter, and YouTube.
For example:
Publish a Post
Use the /post endpoint to publish a post via Ayrshare, which can be sent to multiple social networks in a single call.
In the return is the top level Ayrshare Post ID.
Post a Comment
Use the /comments endpoint to post a comment with the Ayrshare Post ID. The commetn will be sent to all the social networks associated with the post.
Get Comments
Use the /comments endpoint to get the comments for the post with the Ayrshare Post ID. This will return comments for all the social networks associated with the post.
Comments with Social Post ID
Sometimes you may want to manage comments on a post that were not published via Ayrshare. In this case you can use the Social Post ID, which is the social network assigned post ID.
If the post was published via Ayrshare, use the Ayrshare Post ID.
For example:
Get Post History
Start by getting the Instagram posts published outside of Ayrshare with the Get All Post History endpoint.
The endpoint returns a list of posts with the social id
of the post.
The social id
is also returned in the postIds
field for the post endpoint.
Get Comments on a Post
Use the returned id
to get all the comments for a specific Instagram post using the social id
, searchPlatformId
set to true
, and platform
set to instagram
.
Use the Comment ID to Get Comment Details
The returned JSON will from the previous step have a commentId
for each comment, which is the social comment ID.
The commentId
can be used to get the comment details for a specific comment. This might be useful if you want to get the comment details for a single comment, such as the replies to the comment.
Comments with Ayrshare Comment ID
Manage comments on a post that were published via Ayrshare by using the Ayrshare Comment ID.
The Ayrshare comment ID is the comment ID assigned from Ayrshare and can be found in the commentId
field in the response when posting a comment.
This is often used if you want to get details on a particular comment published via Ayrshare.
Comments with Social Comment ID
Manage comments on a post that were not published via Ayrshare by using the Social Comment ID.
The social comment ID is the comment ID from the social network, not the Ayrshare ID, and can be found in the commentId
field in the response when getting comments.
This is often used if you want to get details on a particular comment published outside of Ayrshare.
Disable Comments
You can disable comments when publishing a post using the disableComments
field in the /post endpoint. Comments will only be disabled for Instagram, LinkedIn, and TikTok.
You may also enable or disable comments on an already published post.