Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Retrieve a poll

You can retrieve a specific poll by creating and passing the PollRetrievalParams parameters in the sb.poll.get() method.

const params: PollRetrievalParams = {
  channelUrl: channel.url,
  channelType: ChannelType.GROUP,
  pollId: poll.id
};
const poll: Poll = await sb.poll.get(params);

PollRetrievalParams

Parameter nameTypeDescription

channelUrl

string

Specifies the URL of the channel.

channelType

ChannelType

Specifies the type of the channel.

pollId

number

Specifies the unique ID of a poll.