Add Poll Option
The "Add Poll Option" method permits users to contribute new response options, expanding the poll's flexibility and inclusivity. You can integrate this feature by following the given steps.
Steps to Add Poll Option
- To add a new poll option, use the
addPollOption()
method provided by the client. - Pass in the required parameters.
- Process the response as per your requirement.
const payload = {
conversationId: 12122, // Conversation Id
poll: {
text: "",
}, // Text for the new poll option
};
const response = await lmChatClient.addPollOption(payload);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Add Poll Option Payload
Variable | Type | Description | Optional |
---|---|---|---|
conversationId | number | Conversation Id | |
poll | object | Poll object containing the new option text |
Add Poll Option Response
Variable | Type | Description | Optional |
---|---|---|---|
success | boolean | Indicates the success status of the response | |
error_message | string | Error message in case of failure | ✔️ |
data | object | Data object containing the poll details | ✔️ |