Commenting posts
This endpoint allows you to leave comments on specified LinkedIn posts.
POST https://api.linkedapi.io/account/posts.comment
Body
{
"comments": [
{
"post": "https://www.linkedin.com/posts/post1",
"text": "Great post! Thanks for sharing."
},
{
"post": "https://www.linkedin.com/posts/post2",
"text": "I completely agree with your point."
},
{
"post": "https://www.linkedin.com/posts/post3",
"text": "This is a very insightful post. Looking forward to more content like this."
}
]
}
post
– LinkedIn URL of the post to comment.text
– comment text, must be up to 1000 characters.
Response
- If all comments are successful:
{
"status": "complete",
"completion": [
{
"post": "https://www.linkedin.com/posts/post1",
"result": {
"success": true
}
},
{
"post": "https://www.linkedin.com/posts/post2",
"result": {
"success": true
}
},
{
"post": "https://www.linkedin.com/posts/post3",
"result": {
"success": true
}
}
]
}
- If some comments are unsuccessful:
{
"status": "complete",
"completion": [
{
"post": "https://www.linkedin.com/posts/post1",
"result": {
"success": true
}
},
{
"post": "https://www.linkedin.com/posts/post2",
"result": {
"success": false,
"error": {
"errorType": "postNotFound",
"message": "The provided URL is not an existing LinkedIn post."
}
}
},
{
"post": "https://www.linkedin.com/posts/post3",
"result": {
"success": false,
"error": {
"errorType": "commentingNotAllowed",
"message": "Comments are not allowed on this post."
}
}
}
]
}
errorType
– enum with the following possible values:postNotFound
– provided URL is not an existing LinkedIn post.commentingNotAllowed
– commenting is not allowed on this post. This could be due to the post author's privacy settings, LinkedIn restrictions on commenting, or because the post type does not support comments.
Throughout the documentation, for simplicity, only the request body and final response (when status is
complete
) are shown. Consider possible global errors and result handling options for proper implementation.