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 account

The account_id param, previously available either in the query params or in the body, is removed from all methods. The account_id must now be consistently included in the path params.


List all posts

GET /v1/users/:identifier/posts

  • Use GET /v2/:account_id/users/:user_id/posts List all User's Posts.
  • Path param identifier is renamed to user_id.
  • Query param is_company is 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_id Get a Post.
  • The response schema has changed (see Post object changes).

Create post

POST /v1/posts

  • Use POST /v2/:account_id/posts Create a Post.
  • Body param mentions is removed.
    • Use @user_id pattern to mention users within the text param.
  • Body param attachments has changed.
    • Specify an array of objects with filename, content_type and data in base64 encoding.
  • Body param repost is renamed to quoted_post_id.
  • Body param as_organization is renamed to post_as.
📘

Provider specifics

  • Provider options must now be set under specifics.
  • Body param location is moved to specifics.instagram. It has been changed to an object composed of the params id, longitude and latitude.
  • Body param external_link is 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/comments List all Post's Comments.
  • Query param comment_id is removed.
    • Use GET /v2/{account_id}/posts/{post_id}/comments/{comment_id}/replies List all Comment's Replies to get the replies of a specific comment.
  • 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/comments Add Comment to a Post.
  • Body param mentions is removed.
    • Use @user_id pattern to mention users within the text param.
  • Body param comment_id is removed.
    • Use POST /v2/:account_id/posts/:post_id/comments/:comment_id Reply to a Comment instead.
  • Body param as_organization is renamed to comment_as.
  • Body param external_link is 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/reactions List all Post's Reactions.
  • Query param comment_id is removed.
  • 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/reactions Add Reaction to a Post.
  • Body param post_id is removed.
    • Specify the post_id in the path params.
  • Body param reaction_type is removed.
    • Use reaction instead with emoji unicode or provider reaction type.
  • Body param comment_id is removed.
  • Body param as_organization is renamed to react_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 fieldv2 change
social_idRemoved, now use id everywhere.
dateRenamed to created_at
parsed_datetimeRemoved, use date.
reaction_counterRenamed to reactions_counter which now gives counts per reaction type / emoji.
comment_counterRenamed to comments_counter.
repost_counterRenamed to resposts_counter.
user_reactedThe value is now either the value of the reaction (emoji unicode or provider reaction type), or a boolean.
authorThe value is now a User object.
author.nameRenamed to author.display_name.
author.is_companyRemoved, use author.type == organization.
author.headlineRenamed to author.description.
written_byMoved under specifics
repost_idRemoved, use id or quoted_post.id.
reposted_byThe value is now a User object.
reposted_by.nameRenamed to reposted_by.display_name.
reposted_by.is_companyRemoved, use reposted_by.type == organization.
reposted_by.headlineRenamed to reposted_by.description.
repost_contentRenamed to quoted_post.
mentionsRemoved as mentions should be inferred from the text.
groupRemoved.
analytics.impressionsRenamed to analytics.impressions_counter.
analytics.engagementsRenamed to analytics.engagements_counter.
analytics.clicksRenamed to analytics.clicks_counter.
analytics.page_viewers_from_this_postRenamed to analytics.page_viewers_from_this_post_counter.
analytics.followers_gained_from_this_postRenamed to analytics.followers_gained_from_this_post_counter.
analytics.members_reachedRenamed to analytics.users_reached_counter.

Instagram post

v1 fieldsv2 changes
provider_idRenamed to id.
has_audioMoved in specifics.instagram.
has_likedRenamed to user_reacted.
like_countRemoved, use reactions_counter.
comment_countRenamed to comments_counter.
like_and_view_counts_disabledRemoved, use reaction_counter == null and impressions_counter == null.
comments_disabledRemoved, use permissions.can_comment.
accessibility_captionMoved in specifics.instagram.
captionRenamed to text.
videoRemoved, use attachments.
preview_imageRemoved, use attachments.
ownerRemoved, use author.
locationMoved 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 paging is removed, use total_count instead.
  • Property cursor is renamed to next_cursor.


Comment object changes

v1 fieldsv2 changes
post_idRemoved.
has_audioMoved in specifics.instagram.
has_likedRenamed to user_reacted.
like_countRemoved, use reactions_counter.
comment_countRenamed to comments_counter.
like_and_view_counts_disabledRemoved, use reaction_counter == null and impressions_counter == null.
comments_disabledRemoved, use permissions.can_comment.
accessibility_captionMoved in specifics.instagram.
captionRenamed to text.
videoRemoved, use attachments.
preview_imageRemoved, use attachments.
ownerRemoved, use author.
locationMoved 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 paging is removed, use total_count instead.
  • Property cursor is renamed to next_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 fieldsReaction equivalent
authorRenamed to sender. It is now a User object.
author.typeMoved to sender. Enum values has changed to either individual or organization.
author.headlineRenamed to sender.description.
author.network_distanceRemoved, get UserProfile instead.
post_idRemoved, useless in Unipile v2.
comment_idRemoved, useless in Unipile v2.
valueThe 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 paging is removed, use total_count instead.
  • Property cursor is renamed to next_cursor.