Skip to main content

Post Reports

The postReport() method is used to submit a report for moderation purposes. This method allows users to report specific entities, such as messages or profiles, providing details like tags and reasons for the report.

Steps to Post a Report

  1. Create a PostReportRequest object with the required details.
  2. Call the postReport() function using the instance of the LMChatClient class.
  3. Handle the response (LMResponse<void>) to confirm the report submission.
PostReportRequest request = (PostReportRequestBuilder()
..tagId(1) // Provide the report tag ID
..reason("Inappropriate content") // Optional
..entityId("ENTITY_ID") // Provide the ID of the entity
..entityCreatorId("CREATOR_ID") // Optional
..entityType(1)) // Optional
.build();

final LMResponse<void> response = await lmChatClient.postReport(request);

if (response.success) {
// Handle successful report submission
handleSuccess();
} else {
// Handle error
handleError(response);
}
tip

The tagId and entityId parameters are mandatory. Use appropriate tags and entity details based on your application's moderation requirements.

Models

PostReportRequest

List of parameters for the PostReportRequest class:

VariableTypeDescriptionOptional
tagIdintID of the report tag
reasonStringReason for the report✔️
entityIdStringID of the entity being reported
entityCreatorIdStringID of the creator of the reported entity✔️
entityTypeintType of the entity (e.g., message, user, post, etc.)✔️