Skip to main content

Pin Post

The pinPost() function allows users to conveniently "pin" posts, granting them the ability to highlight and prioritize important content on their feed. This feature ensures that selected posts remain prominently displayed at the top of the feed for improved visibility and easy access.

Steps to Pin a Post

  1. Create an instance of PinPostRequest with the required parameter: postId for the post to be pinned.
  2. Call the pinPost() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. Use the response as per your requirement.
// Create an instance of PinPostRequest
PinPostRequest request = (PinPostRequestBuilder()
..postId("post_id"))
.build();

// Get the response from calling the function
final PinPostResponse pinPostResponse = await lmFeedClient.pinPost(pinPostRequest);

// Process the response, as per requirement
if (pinPostResponse.success) {
// your function to handle successful post pinning
handlePinPostSuccess();
} else {
// your function to handle error message
handlePinPostError(pinPostResponse.errorMessage);
}

Models

PinPostRequest

List of parameters for the PinPostRequest class

VariableTypeDescriptionOptional
postIdStringID of the post to be pinned

PinPostResponse

List of parameters for the PinPostResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure