Post Report
Allows users to report a chatroom, message, or member for inappropriate content or behavior. This function submits a report based on the provided details.
Steps to post a report
- Create a PostReportRequest object using
PostReportRequest.builder(tagId:)
class by passing all the required parameters. - Call
postReport()
function using the instance ofLMChatClient
. - Process the response LMResponse<NoData> to check for success or failure.
// object of PostReportRequest
let request = PostReportRequest.builder(tagId: 1)
.reason("ENTER_REASON")
.uuid("ENTER_UUID")
.reportedConversationId("ENTER_CONVERSATION_ID")
.build()
LMChatClient.shared.postReport(request: request) { response in
// response (LMResponse<NoData>)
if response.error == nil {
// Report submitted successfully
handleSuccessfulReport()
} else {
// Error in submitting report
handleError(response.error)
}
}
Models
PostReportRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
tagId | Int | ID of the report tag | |
reason | String | Detailed reason for the report | ✔️ |
uuid | String | UUID of the reported member (if reporting a user) | ✔️ |
reportedConversationId | String | ID of the reported conversation (if reporting a message) | ✔️ |
reportedChatroomId | String | ID of the reported chatroom (if reporting a chatroom) | ✔️ |
reportedLink | String | Reported link (if reporting a link) | ✔️ |
ReportEntityType
VALUE | DESCRIPTION |
---|---|
chatroom | Report for a chatroom |
message | Report for a message |
member | Report for a member |