# Ask a Yes / No / Later question

_Yes — three buttons Yes, No, Later with no template within 24 h; the choice comes back in button_id and "Later" is handled on your side (scheduled follow-up)._

Keywords: yes no, yes/no, later, closed question, accept decline, approve, consent, follow-up, remind me later, yes no buttons, binary choice

## Scenario

You ask a closed question ("Do you want to receive your invoices on WhatsApp?") and leave three outcomes: yes, no, or "later". The customer taps, your server reads `button_id` and acts.

**Yes, it is possible without a template**, with three quick-reply buttons, if the customer wrote to you in the last 24 h. Outside 24 h, the question must be asked with a [template with buttons](https://console.geskap.com/docs/boutons-template-reponse-rapide?lang=en).

## Conversation

```text
You      : Awa, do you want to receive your invoices here, on WhatsApp?
           [ Yes ]  [ No ]  [ Later ]
Customer : (taps "Later")
Webhook  : message.inbound  type=text  text="Later"  button_id="optin:later"
You      : OK, I will ask again in a few days.
```

## Code

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages/interactive" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000001",
  "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
  "buttons": [
    { "id": "optin:yes", "title": "Oui" },
    { "id": "optin:no", "title": "Non" },
    { "id": "optin:later", "title": "Plus tard" }
  ]
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages/interactive", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000001",
    "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
    "buttons": [
      { "id": "optin:yes", "title": "Oui" },
      { "id": "optin:no", "title": "Non" },
      { "id": "optin:later", "title": "Plus tard" }
    ]
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages/interactive");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000001",
    "body" => "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
    "buttons" => [
      ["id" => "optin:yes", "title" => "Oui"],
      ["id" => "optin:no", "title" => "Non"],
      ["id" => "optin:later", "title" => "Plus tard"],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages/interactive",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000001",
        "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
        "buttons": [
            {"id": "optin:yes", "title": "Oui"},
            {"id": "optin:no", "title": "Non"},
            {"id": "optin:later", "title": "Plus tard"},
        ],
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Reception:

```js
switch (data.button_id) {
  case "optin:yes":   await db.setOptIn(data.from, true);  break;
  case "optin:no":    await db.setOptIn(data.from, false); break;
  case "optin:later": await db.scheduleAsk(data.from, { inDays: 3 }); break; // your scheduler
  default:            /* the customer typed text: handle data.text */ ;
}
```

See [Know which button or list row the customer tapped](https://console.geskap.com/docs/recuperer-le-clic?lang=en) to receive the signed webhook.

## Exact limits

| Item | Limit |
|---|---|
| Buttons | 1 to 3: three are enough for Yes / No / Later |
| Button title | 20 characters |
| Button `id` | 256 characters |
| Question text (`body`) | 1,024 characters |

> **Pitfall:** "Later" is only a received answer: the API reminds nothing by itself. It is up to you to note the date and ask again. If the customer has not written for more than 24 h by then, the follow-up must go through a [template](https://console.geskap.com/docs/ecrire-premier-message?lang=en), not these buttons (`400` "Hors de la fenêtre de 24h").

> **Pitfall:** do not infer consent from silence or from the button title alone: record the choice by its `id` with the date. A customer can also reply "stop" as text: see [Stop / unsubscribe](https://console.geskap.com/docs/stop-desinscription?lang=en).

_Proof — verified in the API source: api_schemas.py, public_api.py, webhooks.py ; applied by the WhatsApp demo: engine._

---

# Poser une question Oui / Non / Plus tard

_Oui — trois boutons Oui, Non, Plus tard sans template dans les 24 h ; le choix revient dans button_id et « Plus tard » est à gérer chez vous (relance planifiée)._

Mots-clés: oui non, oui/non, plus tard, question fermée, accepter refuser, valider, consentement, relance, rappeler plus tard, boutons oui non, choix binaire

## Scénario

Vous posez une question fermée (« Voulez-vous recevoir votre facture par WhatsApp ? ») et laissez trois issues : oui, non, ou « plus tard ». Le client touche, votre serveur lit `button_id` et agit.

**Oui, c'est possible sans template**, avec trois boutons de réponse rapide, si le client vous a écrit dans les dernières 24 h. Hors des 24 h, la question doit être posée par un [template à boutons](https://console.geskap.com/docs/boutons-template-reponse-rapide).

## Conversation

```text
Vous    : Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?
          [ Oui ]  [ Non ]  [ Plus tard ]
Client  : (touche « Plus tard »)
Webhook : message.inbound  type=text  text="Plus tard"  button_id="optin:later"
Vous    : D'accord, je vous reposerai la question dans quelques jours.
```

## Code

```bash
# curl
curl -X POST "https://wa-api.geskap.com/v1/messages/interactive" \
  -H "Authorization: Bearer $GESKAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "+237690000001",
  "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
  "buttons": [
    { "id": "optin:yes", "title": "Oui" },
    { "id": "optin:no", "title": "Non" },
    { "id": "optin:later", "title": "Plus tard" }
  ]
}'
```

```js
// Node.js
const res = await fetch("https://wa-api.geskap.com/v1/messages/interactive", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GESKAP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+237690000001",
    "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
    "buttons": [
      { "id": "optin:yes", "title": "Oui" },
      { "id": "optin:no", "title": "Non" },
      { "id": "optin:later", "title": "Plus tard" }
    ]
  }),
});
console.log(res.status, await res.json());
```

```php
// PHP
$ch = curl_init("https://wa-api.geskap.com/v1/messages/interactive");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("GESKAP_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "to" => "+237690000001",
    "body" => "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
    "buttons" => [
      ["id" => "optin:yes", "title" => "Oui"],
      ["id" => "optin:no", "title" => "Non"],
      ["id" => "optin:later", "title" => "Plus tard"],
    ],
  ]),
]);
$res = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $res;
```

```python
# Python
import os, requests

res = requests.request(
    "POST",
    "https://wa-api.geskap.com/v1/messages/interactive",
    headers={"Authorization": f"Bearer {os.environ['GESKAP_API_KEY']}"},
    json={
        "to": "+237690000001",
        "body": "Awa, voulez-vous recevoir vos factures ici, sur WhatsApp ?",
        "buttons": [
            {"id": "optin:yes", "title": "Oui"},
            {"id": "optin:no", "title": "Non"},
            {"id": "optin:later", "title": "Plus tard"},
        ],
    },
    timeout=15,
)
print(res.status_code, res.json())
```

Réception :

```js
switch (data.button_id) {
  case "optin:yes":   await db.setOptIn(data.from, true);  break;
  case "optin:no":    await db.setOptIn(data.from, false); break;
  case "optin:later": await db.scheduleAsk(data.from, { inDays: 3 }); break; // votre planificateur
  default:            /* le client a tapé du texte : traitez data.text */ ;
}
```

Voir [Savoir quel bouton ou quelle ligne le client a touché](https://console.geskap.com/docs/recuperer-le-clic) pour recevoir le webhook signé.

## Limites exactes

| Élément | Limite |
|---|---|
| Boutons | 1 à 3 : trois suffisent pour Oui / Non / Plus tard |
| Titre d'un bouton | 20 caractères |
| `id` d'un bouton | 256 caractères |
| Texte de la question (`body`) | 1 024 caractères |

> **Piège :** « Plus tard » n'est qu'une réponse reçue : l'API ne rappelle rien toute seule. C'est à vous de noter la date et de reposer la question. Si le client n'a pas écrit depuis plus de 24 h à ce moment-là, la relance doit passer par un [template](https://console.geskap.com/docs/ecrire-premier-message), pas par ces boutons (`400` « Hors de la fenêtre de 24h »).

> **Piège :** ne déduisez pas le consentement d'un silence ni du seul libellé du bouton : enregistrez le choix par son `id` avec la date. Un client peut aussi répondre « stop » en texte : voir [Stop / désinscription](https://console.geskap.com/docs/stop-desinscription).

_Preuve — vérifié dans le code de l'API : api_schemas.py, public_api.py, webhooks.py ; appliqué par la démo WhatsApp : engine._

Support: WhatsApp +237 6 56 09 88 31 · All recipes: https://wa-api.geskap.com/llms.txt
