curl --request POST \
--url https://gate.whapi.cloud/messages/interactive \
--header 'accept: application/json' \
--header 'authorization: Bearer Your_Token' \
--header 'content-type: application/json' \
--data '
{
"to": "447123456789",
"type": "list",
"header": {
"text": "Choose a visit time"
},
"body": {
"text": "Tap View times and pick an open slot for your visit."
},
"footer": {
"text": "Clinic bookings via WhatsApp"
},
"action": {
"list": {
"label": "View times",
"sections": [
{
"title": "Available slots",
"rows": [
{
"id": "slot-2026-04-02-10-00",
"title": "Wed 10:00",
"description": "Open \u00b7 Dr. Lee"
},
{
"id": "slot-2026-04-02-11-30",
"title": "Wed 11:30",
"description": "Open \u00b7 Dr. Lee"
},
{
"id": "slot-2026-04-02-14-00",
"title": "Wed 14:00",
"description": "Open \u00b7 Dr. Lee"
}
]
}
]
}
}
}
'
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gate.whapi.cloud/messages/interactive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"to\": \"447123456789\", \"type\": \"list\", \"header\": {\"text\": \"Choose a visit time\"}, \"body\": {\"text\": \"Tap View times and pick an open slot for your visit.\"}, \"footer\": {\"text\": \"Clinic bookings via WhatsApp\"}, \"action\": {\"list\": {\"label\": \"View times\", \"sections\": [{\"title\": \"Available slots\", \"rows\": [{\"id\": \"slot-2026-04-02-10-00\", \"title\": \"Wed 10:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-11-30\", \"title\": \"Wed 11:30\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-14-00\", \"title\": \"Wed 14:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}]}]}}}",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"authorization: Bearer Your_Token",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://gate.whapi.cloud/messages/interactive"
payload = {
"to": "447123456789",
"type": "list",
"header": {
"text": "Choose a visit time"
},
"body": {
"text": "Tap View times and pick an open slot for your visit."
},
"footer": {
"text": "Clinic bookings via WhatsApp"
},
"action": {
"list": {
"label": "View times",
"sections": [
{
"title": "Available slots",
"rows": [
{
"id": "slot-2026-04-02-10-00",
"title": "Wed 10:00",
"description": "Open \u00b7 Dr. Lee"
},
{
"id": "slot-2026-04-02-11-30",
"title": "Wed 11:30",
"description": "Open \u00b7 Dr. Lee"
},
{
"id": "slot-2026-04-02-14-00",
"title": "Wed 14:00",
"description": "Open \u00b7 Dr. Lee"
}
]
}
]
}
}
}
headers = {
"accept": "application/json",
"authorization": "Bearer Your_Token",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const response = await fetch('https://gate.whapi.cloud/messages/interactive', {
method: 'POST',
headers: {
accept: 'application/json',
authorization: 'Bearer Your_Token',
'content-type': 'application/json',
},
body: JSON.stringify({"to": "447123456789", "type": "list", "header": {"text": "Choose a visit time"}, "body": {"text": "Tap View times and pick an open slot for your visit."}, "footer": {"text": "Clinic bookings via WhatsApp"}, "action": {"list": {"label": "View times", "sections": [{"title": "Available slots", "rows": [{"id": "slot-2026-04-02-10-00", "title": "Wed 10:00", "description": "Open \u00b7 Dr. Lee"}, {"id": "slot-2026-04-02-11-30", "title": "Wed 11:30", "description": "Open \u00b7 Dr. Lee"}, {"id": "slot-2026-04-02-14-00", "title": "Wed 14:00", "description": "Open \u00b7 Dr. Lee"}]}]}}}),
});
console.log(await response.text());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"to\": \"447123456789\", \"type\": \"list\", \"header\": {\"text\": \"Choose a visit time\"}, \"body\": {\"text\": \"Tap View times and pick an open slot for your visit.\"}, \"footer\": {\"text\": \"Clinic bookings via WhatsApp\"}, \"action\": {\"list\": {\"label\": \"View times\", \"sections\": [{\"title\": \"Available slots\", \"rows\": [{\"id\": \"slot-2026-04-02-10-00\", \"title\": \"Wed 10:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-11-30\", \"title\": \"Wed 11:30\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-14-00\", \"title\": \"Wed 14:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}]}]}}}");
Request request = new Request.Builder()
.url("https://gate.whapi.cloud/messages/interactive")
.post(body)
.addHeader("accept", "application/json")
.addHeader("authorization", "Bearer Your_Token")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
using RestSharp;
var options = new RestClientOptions("https://gate.whapi.cloud/messages/interactive");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddHeader("authorization", "Bearer Your_Token");
request.AddHeader("content-type", "application/json");
request.AddJsonBody(System.Text.Json.JsonSerializer.Deserialize<object>(@"{\"to\": \"447123456789\", \"type\": \"list\", \"header\": {\"text\": \"Choose a visit time\"}, \"body\": {\"text\": \"Tap View times and pick an open slot for your visit.\"}, \"footer\": {\"text\": \"Clinic bookings via WhatsApp\"}, \"action\": {\"list\": {\"label\": \"View times\", \"sections\": [{\"title\": \"Available slots\", \"rows\": [{\"id\": \"slot-2026-04-02-10-00\", \"title\": \"Wed 10:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-11-30\", \"title\": \"Wed 11:30\", \"description\": \"Open \\u00b7 Dr. Lee\"}, {\"id\": \"slot-2026-04-02-14-00\", \"title\": \"Wed 14:00\", \"description\": \"Open \\u00b7 Dr. Lee\"}]}]}}}"));
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := []byte(`{"to": "447123456789", "type": "list", "header": {"text": "Choose a visit time"}, "body": {"text": "Tap View times and pick an open slot for your visit."}, "footer": {"text": "Clinic bookings via WhatsApp"}, "action": {"list": {"label": "View times", "sections": [{"title": "Available slots", "rows": [{"id": "slot-2026-04-02-10-00", "title": "Wed 10:00", "description": "Open \u00b7 Dr. Lee"}, {"id": "slot-2026-04-02-11-30", "title": "Wed 11:30", "description": "Open \u00b7 Dr. Lee"}, {"id": "slot-2026-04-02-14-00", "title": "Wed 14:00", "description": "Open \u00b7 Dr. Lee"}]}]}}}`)
req, _ := http.NewRequest("POST", "https://gate.whapi.cloud/messages/interactive", bytes.NewReader(body))
req.Header.Set("accept", "application/json")
req.Header.Set("authorization", "Bearer Your_Token")
req.Header.Set("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}