Skip to main content

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

  1. Create a PostReportRequest object using PostReportRequest.builder(tagId:) class by passing all the required parameters.
  2. Call postReport() function using the instance of LMChatClient.
  3. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
tagIdIntID of the report tag
reasonStringDetailed reason for the report✔️
uuidStringUUID of the reported member (if reporting a user)✔️
reportedConversationIdStringID of the reported conversation (if reporting a message)✔️
reportedChatroomIdStringID of the reported chatroom (if reporting a chatroom)✔️
reportedLinkStringReported link (if reporting a link)✔️

ReportEntityType

VALUEDESCRIPTION
chatroomReport for a chatroom
messageReport for a message
memberReport for a member