Post Endpoints

Description of endpoints used to get data related to posts on the DeSo blockchain

Please make sure you've read Data: API so you are familiar with the following types referenced in this documentation:

Get Posts Stateless

POST /api/v0/get-posts-stateless

Get Posts Stateless returns an array of posts based on the request body. This endpoint is used to fetch posts for many different kinds of feeds.

To fetch the global feed, set GetPostsForGlobalWhitelist to true

To fetch the following feed for a user, set GetPostsforFollowFeed to true

To fetch the admin view of posts ordered by creator coin price, set GetPostsByDeSo to true and provide a value for PostsByDESOMinutesLookback

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Posts Stateless - Use Get Posts Stateless to get the global feed - Use Get Posts Stateless to get the following feed for a user - Use Get Posts Stateless to get posts ordered by time for an admin to curate the global feed - Use Get Posts Stateless to get posts from user's with the high coin prices in the last hour

Request Body

{
  "PostsFound": [<PostEntryResponse>, <PostEntryResponse>], // Array of PostEntryResponses that were found for the provided request body.
}

Get Single Post

POST /api/v0/get-single-post

Gets a single post, optionally including parents and children. This endpoint is used to display a thread view of a post.

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Single Post - Use GetSinglePost to get a thread view of a post

Request Body

{
 "PostFound": <PostEntryResponse>, // A single PostEntryResponse that optionally contains all children and parent of itself.
}

Get Posts For Public Key

POST /api/v0/get-posts-for-public-key

Get posts created by a public key or username. This endpoint is used to populate the posts on a user's profile page.

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Posts For Public Key - Use GetPostsForPublicKey to get posts to display on a user's profile

Request Body

{
  "Posts": [<PostEntryResponse>, <PostEntryResponse>], // Array of PostEntryResponses representing a page of results for posts created by the provided public key.
  "LastPostHashHex": "21285bd8c0ed74125cd82a65a74606d8fcb84e309f58bb44b6cb0b76489897b5", //Hex of the last Post Hash in the array of Posts above.  
}

Get Hot Feed

POST /api/v0/get-hot-feed

Get Hot Feed returns a page of Posts that are currently "hot". A post's hotness is determined by the time since the post was created and the number of likes, diamonds, comments, reposts, and quote reposts.

Endpoint implementation in backend.

Example usages in diamondapp.com's frontend: - Make request to Get Hot Feed - Use GetHotFeed to get posts to display to the user in the Hot Feed tab

Request Body

{
  "HotFeedPage": [<PostEntryResponse>, <PostEntryResponse>,...] // Array of PostEntryResponses that represent the next page of the hot feed for the reader
}

Get Diamonded Posts

POST /api/v0/get-diamonded-posts

Get all posts on which sender sent diamonds to the receiver. Posts are sorted by the number of diamonds given from the sender to the receiver and then by timestamp.

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Diamonded Posts - Use GetDiamondedPosts to get posts in which a specific user received diamonds from another specific user. Example on node.deso.org

Request Body

{
  "DiamondedPosts": [<PostEntryResponse>, <PostEntryResponse>] // Array of PostEntryResponses. Each post is a post created by the receiver AND received diamonds from the sender. The DiamondsFromSender attribute is populated in each PostEntryResponse. Posts are ordered by DiamondsFromSender and then by timestamp.
}

Get Likes For Post

POST /api/v0/get-likes-for-post

Get Profiles of users who liked a given post.

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Likes For Post - Use GetLikesForPosts to show all users who have liked a po

Request Body

{
  "Likers": [<ProfileEntryResponse>, <ProfileEntryResponse>] // ProfileEntryResponses for users who liked this post.
}

Get Diamonds For Post

POST /api/v0/get-diamonds-for-post

Get Profiles and number of diamonds for users who gave diamonds to a given post

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Diamonds For Post - Use GetDiamondsForPosts to show all users who have diamonded a post and how many diamonds the user gave

Request Body

{
  "DiamondSenders": [
    { 
      "DiamondSenderProfile": <ProfileEntryResponse>, // Profile of the user who gave diamonds to this post
      "DiamondLevel":  2 // Number of diamonds this user gave to this post
    }
  ]
}

Get Reposts For Post

POST /api/v0/get-reposts-for-post

Get Profiles of users who reposted (without a quote) a given post

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Reposts For Post - Use GetRepostsForPosts to show all users who have reposted a post

Request Body

{
  "Reposters": [<ProfileEntryResponse>, <ProfileEntryResponse>] // Profiles of users who reposted (without a quote) this post.
}

Get Quote Reposts For Post

POST /api/v0/get-quote-reposts-for-post

Get profiles of users who quote reposted a given post and the content of the quote repost

Endpoint implementation in backend.

Example usages in frontend: - Make request to Get Quote Reposts For Post - Use GetQuoteRepostsForPost to show all users who have quoted reposted a post and what the quote said

Request Body

{
  "QuoteReposts": [<PostEntryResponse>, <PostEntryResponse>] // Post that quote reposted this quote. Each PostEntryResponse will have a ProfileEntryResponse in it.
}

Last updated