get()
get(id: EntryIdType, orderOptionsBy = OrderBy.Asc): Promise<PollWithOptions>
Get information about a specific poll.
Parameters:
id(EntryIdType): The ID of the poll for which you want to retrieve information.orderOptionsBy(OrderBy, optional): The order in which to retrieve poll options. Default isOrderBy.Asc(ascending).
Returns:
A
Promiseresolving to the poll object (PollWithOptions) containing details about the specified poll.
Example:
const pollIdToRetrieve = 1;
try {
const retrievedPoll = await pollz.polls.get(pollIdToRetrieve);
console.log('Retrieved Poll:', retrievedPoll);
} catch (error) {
console.error('Failed to retrieve poll:', error.message);
}The get method allows you to retrieve detailed information about a specific poll by providing its unique ID (id). You can also specify the order in which the poll options should be retrieved using the optional parameter orderOptionsBy.
The method returns a Promise resolving to the poll object (PollWithOptions), which includes information such as the poll ID, name, creation date, associated poll type, options, total votes, and more.
Note: Ensure that the provided id corresponds to an existing poll in the system.
Last updated