Manage post reactions
Learn how to manage post reactions on LinkedIn using Unipile API.
About Post IDsBasically, Unipile uses base64 preformatted post IDs to simplify any interactions that require a post ID. These are the IDs to be used throughout, unless otherwise specified.
List reactions
Note about paginationPagination on the following endpoints uses exclusively the
offsetparameter.
On a post
To list the reactions on a post, use the List all Post's Reactions endpoint, specifying the post ID.
const { data } = await postsApi.getPostReactionsList({
path: {
account_id: "acc_123456789",
post_id: "post_id",
},
});reactions = posts_api.get_post_reactions_list("post_id", "acc_123456789")curl --request GET \
--url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
--header 'accept: application/json'On a comment
To list the reactions on a post comment, use the List all Comment's Reactions endpoint, specifying the post ID and the comment ID.
const { data } = await postsApi.getPostCommentReactionsList({
path: {
account_id: "acc_123456789",
post_id: "post_id",
comment_id: "comment_id",
},
});reactions = posts_api.get_post_comment_reactions_list(
"post_id",
"comment_id",
"acc_123456789",
)curl --request GET \
--url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
--header 'accept: application/json'Add a reaction
LinkedIn uses the following predefined reactions in the posts ecosystem :
: the Like reaction (linkedin_liketype)
: the Celebrate reaction (linkedin_celebratetype)
: the Support reaction (linkedin_supporttype)
: the Love reaction (linkedin_lovetype)
: the Insightful reaction (linkedin_insighfultype)
: the Funny reaction (linkedin_funnytype)
To a post
To react to a post, use the Add Reaction to a Post endpoint, specifying the post ID and the reaction type in the reaction field of the request body.
await postsApi.addPostReaction({
path: {
account_id: "acc_123456789",
post_id: "post_id",
},
body: {
reaction: 'linkedin_celebrate'
},
});posts_api.add_post_reaction(
"post_id",
"acc_123456789",
{"reaction": "linkedin_celebrate"},
)curl --request POST \
--url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
--header 'accept: application/json'
--data '
{
"reaction": "linkedin_celebrate"
}
'To a comment
To react to a post comment, use the Add Reaction to a Comment endpoint, specifying the post ID, the comment ID and the reaction type in the reaction field of the request body.
await postsApi.addPostCommentReaction({
path: {
account_id: "acc_123456789",
post_id: "post_id",
comment_id: "comment_id",
},
body: {
reaction: 'linkedin_funny'
},
});posts_api.add_post_comment_reaction(
"post_id",
"comment_id",
"acc_123456789",
{"reaction": "linkedin_funny"},
)curl --request POST \
--url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
--header 'accept: application/json'
--data '
{
"reaction": "linkedin_celebrate"
}
'Remove a reaction
From a post
To remove a reaction from a post, use the Remove Reaction from a Post endpoint, specifying the post ID.
await postsApi.removePostReaction({
path: {
account_id: "acc_123456789",
post_id: "post_id",
},
body: {
reaction: 'linkedin_support'
},
});posts_api.remove_post_reaction(
"post_id",
"acc_123456789",
{"reaction": "linkedin_support"},
)curl --request DELETE \
--url https://api.unipile.com/v2/account_id/posts/post_id/reactions \
--header 'accept: application/json'
--data '
{
"reaction": "linkedin_support"
}
'From a comment
To remove a reaction from a post comment, use the Remove Reaction from a Comment endpoint, specifying the post ID and the comment ID.
await postsApi.removePostCommentReaction({
path: {
account_id: "acc_123456789",
post_id: "post_id",
comment_id: "comment_id",
},
body: {
reaction: 'linkedin_like'
},
});posts_api.remove_post_comment_reaction(
"post_id",
"comment_id",
"acc_123456789",
{"reaction": "linkedin_like"},
)curl --request DELETE \
--url https://api.unipile.com/v2/account_id/posts/post_id/comments/comment_id/reactions \
--header 'accept: application/json'
--data '
{
"reaction": "linkedin_like"
}
'Updated about 7 hours ago