For the complete documentation index, see llms.txt. This page is also available as Markdown.

Send Quizzes and Questions to WhatsApp Channels

Create & Share Quizzes on WhatsApp

Whapi.Cloud allows you to publish interactive quizzes and open questions directly to a WhatsApp Channel, also known as a newsletter.

These message types can be used to test subscribers’ knowledge, collect feedback, run interactive activities, or encourage engagement with your Channel content.

Before you start

You will need:

  • An authorized Whapi.Cloud channel and its API token;

  • Administrator access to the WhatsApp Channel;

  • The Channel ID in the @newsletter format.

A Channel ID looks like this:

120363298746512907@newsletter

In order to find out the identifier use the following method: GET /newsletters

Send a quiz

Use the following endpoint to publish a quiz:

POST https://gate.whapi.cloud/messages/quiz

Example:

Parameters

Required:

  • to β€” the Channel ID. It must end with @newsletter.

  • title β€” the quiz question.

  • options β€” an array with 2 to 12 answer options.

  • correct_option_index β€” the index of the correct answer.

Optional:

  • end_time β€” quiz end time as a Unix timestamp.

  • hide_participant_name β€” hides participant information.

  • allow_add_option β€” allows participants to add their own option.

Important: indexes start from zero

The first answer in the options array has index 0.

In this example:

  • Mars β€” index 0;

  • Venus β€” index 1;

  • Jupiter β€” index 2.

Send an open question

An open question allows subscribers to submit a written response instead of selecting one of several predefined options.

Use the following endpoint to send question message:

POST https://gate.whapi.cloud/messages/question

Example:

Required parameters:

  • to β€” the Channel ID ending with @newsletter;

  • body β€” a non-empty question text.


Enable Channel tracking

To receive quiz votes and question responses, enable tracking for the Channel:

POST /newsletters/{NewsletterID}/tracking

Example:

We recommend renewing the tracking subscription at least once every 24 hours.

Receive responses

After tracking is enabled, you can receive updates in two ways:

  • Through MESSAGES PATCH webhooks;

  • By requesting the message directly:

The webhook option is better for automatic processing. The GET method is useful when you need the current state of a specific message.

Quiz result example

Important fields:

  • total β€” total number of votes;

  • results β€” results for each option;

  • count β€” number of votes;

  • voters β€” participant identifiers;

  • correct_answer β€” the correct answer.

Phone numbers and LID identifiers

If the participant is available through WhatsApp contacts, the voters array may contain a phone number.

Otherwise, WhatsApp may return an identifier ending with @lid:

A LID is an internal WhatsApp identifier. Your integration should support both phone numbers and LID values. Read more about @lid here: WhatsApp LID (@lid)

Last updated