Skip to main content

Post Report

The postReport() function is used to report a post. It takes a PostReportRequest as input, including the tagId, reason, entityId, entityCreatorId, and entityType. The function returns a PostReportResponse as a Future.

Steps to Report a Post​

  1. Create an instance of PostReportRequest using PostReportRequestBuilder class.
  2. Call the postReport() 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 PostReportRequest
final PostReportRequest postReportRequest = (PostReportRequestBuilder()
..tagId(1)
..reason('Inappropriate content')
..entityId('post_id_to_report')
..entityCreatorId(creator_id)
..entityType(0)) // Assuming 0 represents a post type
.build();

// Get the response from calling the function
final PostReportResponse postReportResponse = await lmFeedClient.postReport(postReportRequest);

// Process the response, as per requirement
if (postReportResponse.success) {
// your function to handle successful post reporting
handlePostReportSuccess();
} else {
// your function to handle error message
handlePostReportError(postReportResponse.errorMessage);
}

Models​

PostReportRequest​

List of parameters for the PostReportRequest class

VariableTypeDescriptionOptional
tagIdintID of the tag used for reporting
reasonStringReason for reporting the post✔
entityIdStringID of the post to be reported
entityCreatorIdStringID of the creator of the post
entityTypeintType identifier for the post

PostReportResponse​

List of parameters for the PostReportResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure✔