Posts API
This guide will help you migrate the Posts features of your application to API v2.
Methods changed
For each endpoint in the v1 API, here are the corresponding endpoints in the v2 API, along with the necessary modifications to achieve the same results.
Specifying the target accountThe
account_idparam, previously available either in the query params or in the body, is removed from all methods. Theaccount_idmust now be consistently included in the path params.
List all posts
GET /v1/users/:identifier/posts
- Use
GET /v2/:account_id/users/:user_id/postsList all User's Posts. - Path param
identifieris renamed touser_id. - Query param
is_companyis removed. The type of user is now automatically infered. - The response schema has changed (see Post object changes).
Retrieve a post
GET /v1/posts/:post_id
- Use
GET /v2/:account_id/posts/:post_idGet a Post. - The response schema has changed (see Post object changes).
Create post
POST /v1/posts
- Use
POST /v2/:account_id/postsCreate a Post. - Body param
mentionsis removed.- Use @user_id pattern to mention users within the
textparam.
- Use @user_id pattern to mention users within the
- Body param
attachmentshas changed.- Specify an array of objects with
filename,content_typeanddatain base64 encoding.
- Specify an array of objects with
- Body param
repostis renamed toquoted_post_id. - Body param
as_organizationis renamed topost_as.
Provider specifics
- Provider options must now be set under
specifics.- Body param
locationis moved tospecifics.instagram. It has been changed to an object composed of the paramsid,longitudeandlatitude.- Body param
external_linkis removed. Read our Integration guide to learn how to integrate this LinkedIn feature in an even simpler way (Include Links Previews).
List all comments from a post
GET /v1/posts/:post_id/comments
- Use
GET /v2/:account_id/posts/:post_id/commentsList all Post's Comments. - Query param
comment_idis removed.- Use
GET /v2/{account_id}/posts/{post_id}/comments/{comment_id}/repliesList all Comment's Replies to get the replies of a specific comment.
- Use
- The response schema has changed (see CommentList object changes).
Comment a post
POST /v1/posts/:post_id/comments
- Use
POST /v2/:account_id/posts/:post_id/commentsAdd Comment to a Post. - Body param
mentionsis removed.- Use @user_id pattern to mention users within the
textparam.
- Use @user_id pattern to mention users within the
- Body param
comment_idis removed.- Use
POST /v2/:account_id/posts/:post_id/comments/:comment_idReply to a Comment instead.
- Use
- Body param
as_organizationis renamed tocomment_as. - Body param
external_linkis removed. Read our Integration guide to learn how to integrate this LinkedIn feature in an even simpler way (Include Links Previews).
List all reactions from a post
GET /v1/posts/:post_id/reactions
- Use
GET /v2/:account_id/posts/:post_id/reactionsList all Post's Reactions. - Query param
comment_idis removed.- Use
GET /v2/{account_id}/posts/{post_id}/comments/{comment_id}/reactionsList all Comment's Reactions instead.
- Use
- The response schema has changed (see PostReaction object changes).
Add a reaction to a post
POST /posts/reaction
- Use
POST /v2/:account_id/posts/:post_id/reactionsAdd Reaction to a Post. - Body param
post_idis removed.- Specify the
post_idin the path params.
- Specify the
- Body param
reaction_typeis removed.- Use
reactioninstead with emoji unicode or provider reaction type.
- Use
- Body param
comment_idis removed.- Use
POST /v2/{account_id}/posts/{post_id}/comments/{comment_id}/reactionsAdd Reaction to a Comment instead.
- Use
- Body param
as_organizationis renamed toreact_as.
Post object changes
Posts now have a single generic schema for all providers. Here is what changed between the old LinkedIn / Instagram posts and the new Post object.
Linkedin post
| v1 field | v2 change |
|---|---|
social_id | Removed, now use id everywhere. |
date | Renamed to created_at |
parsed_datetime | Removed, use date. |
reaction_counter | Renamed to reactions_counter which now gives counts per reaction type / emoji. |
comment_counter | Renamed to comments_counter. |
repost_counter | Renamed to resposts_counter. |
user_reacted | The value is now either the value of the reaction (emoji unicode or provider reaction type), or a boolean. |
author | The value is now a User object. |
author.name | Renamed to author.display_name. |
author.is_company | Removed, use author.type == organization. |
author.headline | Renamed to author.description. |
written_by | Moved under specifics |
repost_id | Removed, use id or quoted_post.id. |
reposted_by | The value is now a User object. |
reposted_by.name | Renamed to reposted_by.display_name. |
reposted_by.is_company | Removed, use reposted_by.type == organization. |
reposted_by.headline | Renamed to reposted_by.description. |
repost_content | Renamed to quoted_post. |
mentions | Removed as mentions should be inferred from the text. |
group | Removed. |
analytics.impressions | Renamed to analytics.impressions_counter. |
analytics.engagements | Renamed to analytics.engagements_counter. |
analytics.clicks | Renamed to analytics.clicks_counter. |
analytics.page_viewers_from_this_post | Renamed to analytics.page_viewers_from_this_post_counter. |
analytics.followers_gained_from_this_post | Renamed to analytics.followers_gained_from_this_post_counter. |
analytics.members_reached | Renamed to analytics.users_reached_counter. |
Instagram post
| v1 fields | v2 changes |
|---|---|
provider_id | Renamed to id. |
has_audio | Moved in specifics.instagram. |
has_liked | Renamed to user_reacted. |
like_count | Removed, use reactions_counter. |
comment_count | Renamed to comments_counter. |
like_and_view_counts_disabled | Removed, use reaction_counter == null and impressions_counter == null. |
comments_disabled | Removed, use permissions.can_comment. |
accessibility_caption | Moved in specifics.instagram. |
caption | Renamed to text. |
video | Removed, use attachments. |
preview_image | Removed, use attachments. |
owner | Removed, use author. |
location | Moved in specifics.instagram. |
PostList object changes
The PostList object does not exist anymore. List all User's Posts now returns:
- An array of Post objects as
data. - Object
pagingis removed, usetotal_countinstead. - Property
cursoris renamed tonext_cursor.
Comment object changes
| v1 fields | v2 changes |
|---|---|
post_id | Removed. |
has_audio | Moved in specifics.instagram. |
has_liked | Renamed to user_reacted. |
like_count | Removed, use reactions_counter. |
comment_count | Renamed to comments_counter. |
like_and_view_counts_disabled | Removed, use reaction_counter == null and impressions_counter == null. |
comments_disabled | Removed, use permissions.can_comment. |
accessibility_caption | Moved in specifics.instagram. |
caption | Renamed to text. |
video | Removed, use attachments. |
preview_image | Removed, use attachments. |
owner | Removed, use author. |
location | Moved in specifics.instagram. |
CommentList object changes
The CommentList object does not exist anymore. List all Post's Comments now returns :
- An array of Comment objects as
data. - Object
pagingis removed, usetotal_countinstead. - Property
cursoris renamed tonext_cursor.
PostReaction object changes
The PostReaction object does not exist anymore. List all Comment's Reactions and List all Post's Reactions return an array of generic Reaction objects.
| v1 fields | Reaction equivalent |
|---|---|
author | Renamed to sender. It is now a User object. |
author.type | Moved to sender. Enum values has changed to either individual or organization. |
author.headline | Renamed to sender.description. |
author.network_distance | Removed, get UserProfile instead. |
post_id | Removed, useless in Unipile v2. |
comment_id | Removed, useless in Unipile v2. |
value | The value is now either the provider type of the reaction, or an emoji unicode. |
PostReactionList object changes
The CommentList object does not exist anymore. List all Post's Reactions now returns :
- An array of Reaction objects as
data. - Object
pagingis removed, usetotal_countinstead. - Property
cursoris renamed tonext_cursor.
Updated 3 months ago