Skip to main content

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

  1. To add a new poll option, use the addPollOption() method provided by the client.
  2. Pass in the required parameters.
  3. 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

VariableTypeDescriptionOptional
conversationIdnumberConversation Id
pollobjectPoll object containing the new option text

Add Poll Option Response

VariableTypeDescriptionOptional
successbooleanIndicates the success status of the response
error_messagestringError message in case of failure✔️
dataobjectData object containing the poll details✔️