Check DM Status
The checkDMStatus method is used to check the status of the Direct Message (DM) functionality for a specific user. It provides information on whether the DM feature is available and any related call-to-action (CTA) messages.
Steps to Check DM Status
- Create a
CheckDMStatusRequestobject with the requiredreqFromparameter and optionally theuuid. - Call the
checkDMStatus()function using the instance of theLMChatClientclass. - Use the response (
LMResponse<CheckDMStatusResponse>) to retrieve the DM status data.
CheckDMStatusRequest request = (CheckDMStatusRequestBuilder()
..reqFrom("source") // Provide the request source
..uuid("user-uuid")) // Optionally provide the user UUID
.build();
final LMResponse<CheckDMStatusResponse> response = await lmChatClient.checkDMStatus(request);
if (response.success) {
// Use the retrieved DM status data
handleDMStatus(response.data);
} else {
// Handle error
handleError(response);
}
tip
The reqFrom parameter is required to specify the source of the request. You can optionally provide the uuid to check the DM status for a specific user.
Models
CheckDMStatusRequest
List of parameters for the CheckDMStatusRequest class:
| Variable | Type | Description | Optional |
|---|---|---|---|
reqFrom | String | The source of the DM status request | |
uuid | String | Unique identifier for the user | ✔️ |
CheckDMStatusResponse
List of parameters for the CheckDMStatusResponse class:
| Variable | Type | Description | Optional |
|---|---|---|---|
cta | String | Call-to-action message, if any | ✔️ |
showDm | bool | Indicates whether the DM feature is available | ✔️ |