/create

triangle-exclamation

Endpoint Headers:

  • bot-token - Token of the Bot [String] (Required)

  • apikey - Your Api Auth Key [String] (Required)

  • guild-id - ID of the guild to be fetched [Snowflake] (Required)

  • channel-id - ID of the channel to send the poll in [Snowflake] (Required)

Endpoint Body Parameters

  • question - The question to ask [String] (Required)

  • answers - Array of answer objects to choose from [Array] (Required) (See below)

  • duration - How long, in hours, the poll runs for, default 24 [Integer] (Optional)

  • multiselect - Allow users to select multiple answers, default false [Boolean] (Optional)

  • content - Message content outside the poll to send [String] (Optional)

Answer Objects

The answers array will consist of an object for each choice

  • text - The actual content of the answer choice [String] (Required)

  • emoji - An emoji object to display on the answer choice [Object] (Optional)

Emoji Objects

Within the answer objects, is also an emoji object

  • name - Name of emoji, only use for default discord emojis [Unicode Emoji] (Optional)*

  • id - Id of emoji, only use for custom emojis [Snowflake] (Optional)*

circle-exclamation

Examples:

circle-info

Data API version required. Must replace <version> with either release or beta.

chevron-rightBot Designer for Discordhashtag

Example usage of /poll/create endpoint using BDFD

chevron-rightDiscord.jshashtag

Example usage of /poll/create endpoint using Discord.js

Possible Responses (Codes)

chevron-rightCode 200 hashtag

API succeeded and details were fetched.

chevron-rightCode 400hashtag

An error occurred that stopped execution.

chevron-rightCode 401hashtag

Invalid bot token was provided.

Last updated