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 comment will be automatically posted to every social network where the original post was published. For example, if you published the post to Facebook and Instagram, the comment will appear on both platforms.
Get Comments
Use the /comments endpoint to get the comments for the post with the Ayrshare Post ID. This will return all comments from every social network where the post was published. For example, if you posted to Facebook and Instagram, you’ll get comments from both platforms.
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 post ID assigned by the social network.
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.
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 from the previous step will have a commentId
for each comment, which is the social comment ID.
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, such as LinkedIn replies to comments.
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 using the update post endpoint and the disableComments
field.