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
- Create a
PostReportRequest
object with the required details. - Call the
postReport()
function using the instance of theLMChatClient
class. - 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:
Variable | Type | Description | Optional |
---|---|---|---|
tagId | int | ID of the report tag | |
reason | String | Reason for the report | ✔️ |
entityId | String | ID of the entity being reported | |
entityCreatorId | String | ID of the creator of the reported entity | ✔️ |
entityType | int | Type of the entity (e.g., message, user, post, etc.) | ✔️ |