comments

Comments API Endpoint: Post, reply, get, and delete comments on a post.


POST Post a Comment

POST https://app.ayrshare.com/api/comments

Add a comment to a post. Available for Facebook Pages, Instagram, LinkedIn, Reddit, TikTok, X/Twitter, and YouTube.

Comments added to a Twitter Thread will be posted to the first Tweet.

Instagram Story comments are not yet supported by Meta. Premium or Business plan required.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY See Overview for more information.

Profile-Key

string

Profile Key of a user profile.

Request Body

NameTypeDescription

id*

string

Ayrshare Post ID from the /post endpoint.

platforms*

array

List of platforms to add comments. Currently available platforms: facebook, instagram, linkedin, reddit, tiktok, twitter, youtube. If no platforms is specified, the comment will be published to all platforms.

comment*

string

Text of the new comment to add to the post.

{
    "facebook": {
        "status": "success",
        "commentId": "358482752285927_363474831785719", // Facebook Social Comment ID
        "comment": "The best comment ever!",
        "platform": "facebook"
    },
    "instagram": {
        "status": "success",
        "commentId": "17060111860440276", // Instagram Social Comment ID
        "comment": "The best comment ever!",
        "platform": "instagram"
    },
    "linkedin": {
        "status": "success",
        "commentId": "urn:li:comment:(urn:li:activity:7141202289402236928,7141205176207503360)", // LinkedIn Social Comment ID
        "comment": "Someone’s sitting in the shade today because someone planted a tree a long time ago. - Warren Buffett",
        "commentUrn": "urn:li:comment:(urn:li:activity:7141202289402236928,7141205176207503360)", // Social comment Id from LinkedIn
        "platform": "linkedin"
    },
    "youtube": {
        "status": "success",
        "commentId": "UgzIEZsDQKXgHsEnwTR4AaABAa", // YouTube Social Comment ID
        "comment": "The best comment ever!",
        "platform": "youtube"
    },
    "tiktok": {
        "status": "success",
        "commentId": "7260964914699764524", // TikTok Social Comment ID
        "comment": "The best comment ever!",
        "platform": "tiktok",
        "videoId": "7260964048362310959"
    },
    "twitter": {
        "status": "success",
        "commentId": "1525632403262101648", // Twitter Social Comment ID
        "comment": "The best comment ever!",
        "postUrl": "https://twitter.com/ayrshare/status/1525632403262101648"
    },
    "status": "success",
    "commentID": "IUDSCfdYfFkw_dWhW9PLI", // Ayrshare Comment ID. Used for replying to a comment.
    "id": "Ut1fWU6XkqlMayHGnJZ" // Ayrshare Post ID
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"id": "Ut1fWU6XkqkMayHGnJZ", "platforms": ["facebook", "instagram", "linkedin", "reddit", "tiktok", "twitter", "youtube"], "comment": "An amazing comment!"}' \
-X POST https://app.ayrshare.com/api/comments

GET Get Comments

GET https://app.ayrshare.com/api/comments/:id

Get the comments for a given top-level post ID. Available for Facebook Pages, Instagram, LinkedIn, Reddit, TikTok, Twitter, and YouTube.

Replace :id with the post top level Ayrshare Post ID returned from the /post endpoint.

https://app.ayrshare.com/api/comments/Ut1fWU6XkqlMayHGnJZ

Please see the Response 200 of Post a Comment in the section above for an example of the ID Ut1fWU6XkqlMayHGnJZ

Comment data is updated every 10 minutes for all platforms, with the exception of Twitter. Due to restrictions imposed by the Twitter API, the comment data for Twitter is refreshed using an exponential backoff strategy, meaning the intervals between updates gradually increase over time.

Facebook replies to replies have the same parent id regardless of nesting.

Premium or Business plan required.

Path Parameters

NameTypeDescription

id*

string

Ayrshare Post ID from the /post endpoint.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY See Overview for more information.

Profile-Key

string

Profile Key of a user profile.

{
    "facebook": [
        {
            "comment": "What a great comment",
            "commentId": "806720068141593_1849585385469876", // Facebook Social Comment ID
            "commentCount": 3,
            "created": "2024-02-27T19:55:28Z",
            "from": {  // If available. Facebook determines availability based on the user's security profile and settings.
                "name": "John Smith",
                "id": "5075334022535844"
            },
            "likeCount": 342,
            "platform": "facebook",
            "userName": "WondrousTimes", // If available. Facebook determines availability based on the user's security profile and settings.
            "userLikes": false,
            "replies": [ // Facebook replies to replies have the same parent id regardless of nesting.
                {
                    "comment": "Nice Comment 2",
                    "commentId": "806720068141593_320599703877348",
                    "commentCount": 0,
                    "company": true,
                    "created": "2024-02-27T19:55:40Z",
                    "from": {
                        "name": "Sue Me",
                        "id": "5075334022535800"
                    },
                    "likeCount": 3,
                    "parent": {
                        "createdTime": "2024-02-27T19:55:28+0000",
                        "from": {
                            "name": "John Smith",
                            "id": "5075334022535844"
                        },
                        "message": "What a great comment",
                        "id": "806720068141593_1849585385469876"
                    },
                    "platform": "facebook",
                    "userLikes": false
                }
            ]
        }
    ],
    "instagram": [
        {
            "comment": "Love this post.",
            "commentId": "18030599567251077", // Instagram Social Comment ID
            "created": "2022-10-13T00:52:47Z",
            "from": {                    // If available. Instagram determines availability based on the user's security profile and settings.
                "name": "WondrousTimes",
                "id": "112775157855689"
            },
            "hidden": false,    // Is the comment hidden
            "likeCount": 1,
            "parentId": "17999860012861", // The Instagram Social ID of the parent post. Only returned when using get by ID on a reply.
            "platform": "instagram",
            "replies": [
                {
                    "created": "2024-04-04T22:37:39Z",
                    "from": {
                        "id": "178414522127073334",
                        "username": "ayrshare"
                    },
                    "hidden": false,
                    "id": "18023114651100610", // Instagram Social Comment Id
                    "likeCount": 2,
                    "parentId": "178438334431963234",
                    "text": "@ayrshare Thanks",
                    "user": {
                        "id": "17841452212702234"
                    },
                    "username": "ayrshare"
                }
            ],
            "user": {        // ID of Instagram user who created the comment.
                "id": "17841452212707498"
            },
            "userName": "ayrshare"      // If available. Instagram determines availability based on the user's security profile and settings.
        }
    ],
    "linkedin": [
        {
            "comment": "New wonderful comment",
            "commentId": "6961077099692445688", // LinkedIn Social Comment ID
            "commentUrn": "urn:li:comment:(urn:li:activity:7141202289402236928,7141205176207503360)", // Social comment id from LinkedIn
            "created": "2022-08-04T21:55:11Z",
            "from": {
                "name": "Sue Smith",
                "id": "yb8P0Oq5l8",
                "url": "https://www.linkedin.com/in/suesmith",
                "description": "Co-Founder at Smiths"
            },
            "media": [
                {
                    "type": "image",
                    "url": "https://media-exp1.licdn.com/dms/image/D4E2CAQH4RRMRaJSR"
                }
            ],
            "platform": "linkedin",
            "profileImageUrl": "https://media-exp1.licdn.com/dms/image/C5103AQHORT70jVfK",
            "userName": "suesmith"
        },
        {   // Comment from a company
            "comment": "Love it",
            "commentId": "urn:li:comment:(urn:li:activity:71860989603258818,7186100659052515329)",
            "commentUrn": "urn:li:comment:(urn:li:activity:71860989603258818,7186100659052515329)",
            "created": "2024-04-16T20:38:28Z",
            "founded": 2020,
            "from": {
                "name": "Ayrshare",
                "id": 22327643,
                "url": "https://www.linkedin.com/company/22327643",
                "description": "Social Media API"
            },
            "organizationType": "PRIVATELY_HELD",
            "platform": "linkedin",
            "userName": "ayrshare",
            "website": "https://www.ayrshare.com"
        }
    ],
    "reddit": [
        {
            "comment": "Nice comment",
            "commentId": "kaxeilk",
            "created": "2023-11-27T03:09:06.000Z",
            "from": {
                "name": "suppercomment",
                "id": "t2_3zaxa"
            },
            "permalink": "/r/test/comments/184szm7/reddit_post_title/kaxeilk/",
            "subreddit": "test",
            "ups": 1,
            "isSubmitter": true
        }
    ],
    "tiktok": [
        {
            "comment": "The best comment",
            "commentId": "7260964914699764523", // TikTok Social Comment ID
            "created": "2023-07-28T20:12:23Z",
            "liked": false,
            "likes": 0,
            "owner": true,
            "pinned": false,
            "platform": "tiktok",
            "profileImage": "https://p16-sign-va.tiktokcdn.com/tos-maliva-avt-0068/f123c4b57351e266540b93baf07971fd~c5_168x168.jpeg?x-expires=1690747200&x-signature=xVFguEkVmPGJP7ZL2m33Lw7Yj28%3D",
            "replies": 1,
            "replyList": [
                {
                    "comment": "One reply",
                    "commentId": "72776074297628920", // TikTok Social Comment ID
                    "createTime": "2023-09-11 16:34:20",
                    "liked": false,
                    "likes": 0,
                    "owner": false,
                    "parentCommentId": "72776073973290774", // TikTok Parent Social Comment ID
                    "profileImage": "https://p16-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/bcc6e677ecd86e80~c5_168x168.jpeg",
                    "status": "PUBLIC",
                    "userId": "51e0cb95a8b14f0f1020aa017",
                    "username": "ayrshare",
                    "videoId": "7260964048362310958"  // TikTok Social ID
                }
            ],
            "status": "success",
            "userId": "fc904564301a6d383fd19bd4982ba2682404876533c04741a8c3f270376cd3dd",
            "username": "helmar1066",
            "videoId": "7260964048362310958", // TikTok Social ID
            "visibility": "public"
        }
    ],
    "twitter": [
        {
            "comment": "@ayrshare Congrats on this",
            "commentId": "1505595871831891068", // Twitter Social Comment ID
            "created": "2022-05-14T21:56:14.000Z",
            "description": "Eat great!",
            "followersCount": 7,
            "followingCount": 4,
            "id": "1552209331030036480",    // Twitter Social ID
            "listedCount": 0,
            "name": "waffles",
            "platform": "twitter",
            "profileImageUrl": "https://pbs.twimg.com/profile_images/1194272436456890464/lvQZPpt4_normal.png",
            "replyTo": {             // Who the comment was in reply to
                "createdAt": "2012-01-18T21:13:15.000Z",
                "description": "Social Media API",
                "id": "467793290",
                "location": "New York City",
                "name": "Ayrshare",
                "profileImageUrl": "https://pbs.twimg.com/profile_images/1851502252/ayrshare_normal.gif",
                "publicMetrics": {
                    "followersCount": 601,
                    "followingCount": 601,
                    "tweetCount": 11131,
                    "listedCount": 1
                },
                "url": "",
                "username": "anothermadworld"
            },
            "threadNumber": 1,     // If thread, number in sequence
            "tweetCount": 1208,
            "userName": "waffles"
        }
    ],
    "youtube": [
        {
            "channelUrl": "http://www.youtube.com/channel/sp0CnxiNbUU0AJtuYKZwXQ",
            "comment": "Two comments",
            "commentId": "Ugx0tiPuoUpXfrY0qvV4AaABAg", // YouTube Social Comment ID
            "created": "2022-05-24T19:45:49Z",
            "isPublic": true, // This setting indicates whether the comment, including all of its comments and comment replies, is visible to all YouTube users.
            "likeCount": 34,
            "platform": "youtube",
            "profileImageUrl": "https://yt3.ggpht.com/ytc/AKedOLT2hOZirBUGodAg31-QXaGPd9DmrkxR48UXAw=s48-c-k-c0x00ffffff-no-rj",
            "replies": [
                {
                    "comment": "amazing reply",
                    "commentId": "UgzJFjmrrRUr6nsRWi14AaABAg.9ssbUo6Es1n9ssbVwRn2iz",
                    "created": "2023-08-01T15:59:16Z",
                    "likeCount": 2,
                    "platform": "youtube",
                    "userName": "uman",
                    "profileImageUrl": "https://yt3.ggpht.com/ytc/AOPcoUDV_W7h3ZSEcFYrcEuXUPxVCTuF4NTw=s48-c-k-c0x00ffffff-no-rj",
                    "channelUrl": "http://www.youtube.com/channel/sp0CnxiNbUU0AJtuYKZwXQ",
                    "parentId": "UgzJFjmrrRUr6nsRWi14AaABAg"
                }
            ],
            "userName": "ayrshare"
        },
        {
            "channelUrl": "http://www.youtube.com/channel/sp0CnxiNbUU0AJtuYKZwXQ",
            "comment": "One comment",
            "commentId": "Ugx0tiPuoUpXfrY0qvV4AaABAa", // YouTube Social Comment ID
            "created": "2022-05-24T19:00:10Z",
            "isPublic": true, // This setting indicates whether the comment, including all of its comments and comment replies, is visible to all YouTube users.
            "likeCount": 123,
            "platform": "youtube",
            "profileImageUrl": "https://yt3.ggpht.com/ytc/AAKedOLT2hOZirBUGodAg31-QXaGPd9DmrkxR48UXAw=s48-c-k-c0x00ffffff-no-rj",
            "userName": "ayrshare"
        }
    ],
    "status": "success",
    "id": "Ut2fWU6XkqkMayHGnJZ7",
    "lastUpdated": "2023-03-26T22:30:13.035Z",
    "nextUpdate": "2023-03-26T22:41:13.035Z",
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://app.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ

DELETE Delete Comments

DELETE https://app.ayrshare.com/api/comments/:id

Delete either a single comment or all comments under a post that were sent via Ayrshare. Available for Facebook, Instagram, LinkedIn, Reddit, TikTok, X/Twitter, and YouTube.

Path Parameters

NameTypeDescription

id*

string

Top-level Ayrshare Post id or Social Comment ID commentId.

The top-level post id will delete all comments sent via Ayrshare.

The commentId will delete just the comment associated with the commentId.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY See Overview for more information.

Profile-Key

string

Profile Key of a user profile.

Request Body

NameTypeDescription

platform

string

Required only if using the commentId. Values: facebook, instagram, linkedin, reddit, tiktok, twitter, youtube.

{
    "status": "success",
    "facebook": {
        "action": "delete",
        "status": "success",
        "id": "938010233_939392023" // Facebook Social Comment ID
    },
    "instagram": {
        "action": "delete",
        "status": "success",
        "id": "18010439663043269"  // Instagram Social Comment ID
    }, 
    "linkedin": {
        "action": "delete",
        "status": "success",
        "id": "7133271664032669696"  // LinkedIn Social Comment ID
    },
    "tiktok": {
        "action": "delete",
        "status": "success",
        "commentId": "7303719953248109358", // Deprecated December 1, 2023. Use the id field instead.
        "id": "7303719953248109358" // TikTok Social Comment ID
    },
   "twitter": {
        "action": "delete",
        "status": "success",
        "id": "1633128546494459904" // Twitter Social Comment ID
    },
    "youtube": {
        "action": "delete",
        "status": "success",
        "id": "Ugy2m5u-LS9M29Gn3hd4AaABAg"  // YouTub Social Comment ID
    }
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://app.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ

POST Reply to a Comment

POST https://app.ayrshare.com/api/comments/reply

Reply to a comment, i.e. comment on a comment. The endpoint takes the commentId returned from the POST comment endpoint. Please be sure to use the top-level commentId.

Supported platforms: Facebook, Instagram, LinkedIn, TikTok, X/Twitter, and YouTube. For TikTok, please use reply with a comment Id.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY See Overview for more information.

Profile-Key

string

Profile Key of a user profile.

Request Body

NameTypeDescription

commentId*

string

The Ayrshare commentId returned from the POST comment endpoint. Be sure to use the top level commentId.

platforms*

array

Array of platforms to post the reply. Values: facebook, instagram, linkedin, tiktok, twitter, youtube

comment*

string

The reply to add to the comment.

{
    "commentId": "Eh61xHheGHvAqXqGISGVa",
    "twitter": {
        "status": "success",
        "commentId": "1734395672961441821",
        "sourceCommentId": "1734395509526155733",
        "comment": "Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. - Isaac Newton",
        "platform": "twitter",
        "postUrl": "https://twitter.com/ayrshare/status/1734395672961441821"
    },
    "facebook": {
        "status": "success",
        "commentId": "729149842469573_696560159169326",
        "sourceCommentId": "729149842469573_738966840899770",
        "comment": "Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. - Isaac Newton",
        "platform": "facebook"
    },
    "linkedin": {
        "status": "success",
        "commentId": "7140161360574713856",
        "sourceCommentId": "urn:li:ugcPost:7140160850354397187",
        "comment": "Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. - Isaac Newton",
        "platform": "linkedin"
    },
    "youtube": {
        "status": "success",
        "commentId": "UgxZ55j-FDri8lrTgVR4AaABAg.9yCaV71m1fo9yCaZvu7Hj4",
        "sourceCommentId": "UgxZ55j-FDri8lrTgVR4AaABAg",
        "comment": "Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. - Isaac Newton",
        "platform": "youtube"
    },
    "instagram": {
        "status": "success",
        "commentId": "18020060386920755",
        "sourceCommentId": "17998452434360734",
        "comment": "Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things. - Isaac Newton",
        "platform": "instagram"
    },
    "status": "success",
    "id": "ytDgi5vyz36F2yshlJka"
}

Request Examples

curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"commentId": "Ut1fWU6XkqkMayHGnJZ", "platforms": ["facebook", "instagram", "linkedin", "twitter", "youtube"], "comment": "An amazing reply!"}' \
-X POST https://app.ayrshare.com/api/comments/reply

User Profile Comments

Get comments or post comments for a particular user profile by adding the PROFILE_KEY in the header.

Comments by Social ID

Available for Business Plan users only.

Get Comments with a Comment Social Id

Retrieve comments for posts that did not originate via Ayrshare by providing the Social Post ID. This ID is returned in the postIds field of the /post endpoint.

Get Comments with Social ID

Use the Get All Post History endpoint to retrieve posts and IDs originating outside of Ayrshare found in the Social Post ID field.

The linked account must the owner of the post to retrieve the comments.

Support platforms: Facebook, Instagram, LinkedIn, TikTok, Twitter, and YouTube with the following platform values: facebook, instagram, linkedin, tiktok, twitter, youtube

For example, the Get All Post History responses with the Facebook Social ID 104619420979033_758005082307127. This is the Facebook assigned post ID. You can use this ID to retrieve all the comments on this post.

GET Get Comments with Social ID

GET https://app.ayrshare.com/api/comments/:id

Get comments originating outside of Ayrshare.

Comment data is refreshed every 10 minutes.

Facebook replies to replies have the same parent id regardless of nesting.

Path Parameters

NameTypeDescription

id*

string

The social id of the post

Query Parameters

NameTypeDescription

platform*

string

Values: facebook, instagram, linkedin, tiktok,twitter, youtube

searchPlatformId*

boolean

Always equals true

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key

string

Profile Key of a user profile.

{
    "linkedin": [
        {
            "comment": "Yoooo",
            "commentId": "urn:li:comment:(7163252327993327616)",
            "created": "2024-01-02T17:13:35Z",
            "from": {
                "name": "Falling",
                "id": 100831540,
                "url": "https://www.linkedin.com/in/falling",
                "description": ""
            },
            "platform": "linkedin",
            "userName": "falling"
        },
        {
            "comment": "This is a comment",
            "commentId": "urn:li:comment:(7163252327993327618)",
            "created": "2024-01-02T15:02:20Z",
            "from": {
                "name": "Bub Site",
                "id": "1JDzEi51r",
                "url": "https://www.linkedin.com/in/bub",
                "description": "Skydiving is great"
            },
            "platform": "linkedin",
            "profileImageUrl": "https://media.licdn.com/dms/image/D4E0Dnc",
            "userName": "bub"
        }
    ],
    "status": "success",
    "lastUpdated": "2024-02-01T14:17:26.150Z",
    "nextUpdate": "2024-02-01T14:28:26.150Z"
}

Request Example

GET https://app.ayrshare.com/api/comments/104619420979033_758005082307127?searchPlatformId=true&platform=facebook

Get a Comment with Social Comment ID

Facebook, Instagram, and LinkedIn only retrieve a single comment and replies by using the Social Comment ID instead of the Social ID and the additional query parameter commentId=true. For example, the GET /comments endpoint returns the Facebook Social Comment ID 158472752285927_358472912285911. You can then make a call to get the comment and replies with the ID and the commentId=true query parameter.

GET Get Comments with Social Comment ID

GET https://app.ayrshare.com/api/comments/:id

For Facebook, Instagram, and LinkedIn only retrieve a single comment and replies by using the Social Comment ID instead of the Social ID.

Comment data is refreshed every 10 minutes.

Facebook replies to replies have the same parent id regardless of nesting.

Path Parameters

NameTypeDescription

id*

string

The comment social id of the post.

Query Parameters

NameTypeDescription

platform*

string

Values: facebook, instagram, linkedin

commentId*

boolean

Always equals true

searchPlatformId*

boolean

Always equals true

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key

string

{
    "facebook": [
        {
            "comment": "What a great comment",
            "commentId": "806720068141593_1849585385469876", // Facebook Social Comment ID
            "commentCount": 3,
            "created": "2024-02-27T19:55:28Z",
            "from": {  // If available. Facebook determines availability based on the user's security profile and settings.
                "name": "John Smith",
                "id": "5075334022535844"
            },
            "likeCount": 342,
            "platform": "facebook",
            "userName": "WondrousTimes", // If available. Facebook determines availability based on the user's security profile and settings.
            "userLikes": false,
            "replies": [ // Facebook replies to replies have the same parent id regardless of nesting.
                {
                    "comment": "Nice Comment 2",
                    "commentId": "806720068141593_320599703877348",
                    "commentCount": 0,
                    "created": "2024-02-27T19:55:40Z",
                    "from": {
                        "name": "Sue Me",
                        "id": "5075334022535800"
                    },
                    "likeCount": 3,
                    "parent": {
                        "createdTime": "2024-02-27T19:55:28+0000",
                        "from": {
                            "name": "John Smith",
                            "id": "5075334022535844"
                        },
                        "message": "What a great comment",
                        "id": "806720068141593_1849585385469876"
                    },
                    "platform": "facebook",
                    "userLikes": false
                }
            ]
        }
    ],
    "status": "success",
    "lastUpdated": "2023-03-26T22:30:13.035Z",
    "nextUpdate": "2023-03-26T22:41:13.035Z",
}

Request Example

GET https://app.ayrshare.com/api/comments/104619420979033_758005082307127?commentId=true&searchPlatformId=true&platform=facebook

Post, Reply, or Delete a Comment

Publish a comment to a post that was not sent via Ayrshare by using the low-level post Social ID. This ID is returned in the postIds field of the /post endpoint.

Use the Get All Post History endpoint to retrieve posts and IDs originating outside of Ayrshare found in the id field.

The linked account must the owner of the post to retrieve the comments. Support platforms: Facebook, Instagram, LinkedIn, TikTok, and X/Twitter.

Post a Comment with a Social Id

Publish a comment to a to post not originating via Ayrshare using the social Id of the post.

POST Post a Comment with a Social Id

POST https://app.ayrshare.com/api/comments

Publish a comment to a post that was not sent via Ayrshare by using the low-level post Social ID.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key

string

Profile Key for a user profile.

Request Body

NameTypeDescription

id*

string

The social post id returned from the /post endpoint.

platforms*

array

Only one social network allowed: facebook, instagram, linkedin, tiktok, twitter.

comment*

string

The comment to publish.

searchPlatformId*

boolean

Always equals true

{
    "commentId": "9X2RgsF3upquWFVex9e",
    "tiktok": {
        "status": "success",
        "commentId": "7330018345536471",
        "comment": "Genius is one percent inspiration, ninety-nine percent perspiration. - Thomas A. Edison",
        "platform": "tiktok",
        "videoId": "7329662442546564"
    },
    "status": "success",
    "id": "aD0ZSyTbK5AVwRD83"
}

Request Example

POST https://app.ayrshare.com/api/comments

{
    "id": "17945530655454295",    // Required: Social post id return from /post or get all history
    "platforms": ["instagram"],   // Required: Only one social network allowed
    "comment": "This is my new comment,  // Required.
    "searchPlatformId": true      // Required.
}

Reply to a Comment with a Comment Social Id

Reply to a comment not originating via Ayrshare using the comment social ID.

POST Reply to a comment with a comment social ID

POST https://app.ayrshare.com/api/comments/reply

Reply to a comment that was not published via Ayrshare.

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key

string

Profile Key of a user profile

Request Body

NameTypeDescription

commentId*

string

Returned from the /comment endpoint for the specific platform object. For example "facebook": { "commentId": "8392829334" }.

platforms*

array

Only one social network allowed: facebook, instagram, linkedin, tiktok, twitter.

comment*

string

Reply comment text.

searchPlatformId*

boolean

Always set to true.

videoId

string

Only required for TikTok and returned from the POST /comment endpoint.

objResponse

boolean

Response as Object, otherwise as an Array. Default to true starting April 1, 2024

{
    "commentId": "9X2RgsF3upquWFVex9e",
    "tiktok": {
        "status": "success",
        "commentId": "7330018345536471",
        "comment": "Genius is one percent inspiration, ninety-nine percent perspiration. - Thomas A. Edison",
        "platform": "tiktok",
        "videoId": "7329662442546564"
    },
    "status": "success",
    "id": "aD0ZSyTbK5AVwRD83"
}

Request Example

POST https://app.ayrshare.com/api/comments/reply

{
    "commentId": "7311602474321249066", // Required: Social comment id from the social network
    "videoId": "7312588018806967598",   // Only required for TikTok.
    "commentUrn": "urn:li:comment:(urn:li:activity:7141202289402236928,7141205176207503360)", // Only required for LinkedIn
    "platforms": [
        "tiktok"
    ],
    "comment": "Replying to a comment",
    "searchPlatformId": true,
    "objResponse": true // Response as Object, otherwise as an Array. Default to true starting April 1, 2024
}

Delete a Comment with a Comment Social Id

Delete a comment that was not sent via Ayrshare by using the low-level Social ID commentId returned for a particular social network. Supported platforms: Facebook, TikTok, and Twitter.

DELETE Delete Comment with a Comment Social ID

DELETE https://app.ayrshare.com/api/comments

Delete a comment that did not originate via Ayrshare.

Query Parameters

NameTypeDescription

platform*

string

Supported platforms: facebook, instagram, tiktok, twitter.

searchPlatformId*

boolean

Always equals true

Headers

NameTypeDescription

Authorization*

string

Format: Authorization: Bearer API_KEY. See Overview for more information.

Profile-Key

string

Profile Key of a user profile

{
    "status": "success"
}

Request Example

DELETE https://app.ayrshare.com/api/comments/1yNwQOwYmNhqqQRZwvxZ?searchPlatformId=true&platform=facebook

Last updated