Endpoint
POSThttps://api.wapimax.com/whatsapp/v1/sessions/{session_id}/messages/interactive
Authentication
Every request must include your API key in theX-API-Key header. See Authorization to create one.
| Header | Value | Required |
|---|---|---|
X-API-Key | Your WapiMax API key | Yes |
Content-Type | application/json | Yes |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session used to send the message |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient ID, for example 254712345678@s.whatsapp.net |
body_text | string | Yes | Message text |
footer_text | string | No | Footer text |
buttons | array | Yes | Flow buttons |
reply_to | string | No | ID of the message to reply to |
send_at | string | No | Scheduled send time, ISO 8601 UTC |
Button object
| Field | Type | Description |
|---|---|---|
name | string | Button type, for example quick_reply |
button_params_json | string | Button parameters as a JSON string |
button_params_json must be a valid JSON string.Request
curl -X POST "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Get Started\",\"id\":\"get_started\"}"},
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Contact Support\",\"id\":\"contact_support\"}"}
]
}'
const response = await fetch("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive", {
method: "POST",
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
to: "254712345678@s.whatsapp.net",
body_text: "Choose an option to continue.",
footer_text: "WapiMax Interactive",
buttons: [
{ name: "quick_reply", button_params_json: '{"display_text":"Get Started","id":"get_started"}' },
{ name: "quick_reply", button_params_json: '{"display_text":"Contact Support","id":"contact_support"}' }
]
})
});
const data = await response.json();
console.log(data);
// Node.js 18 or later
const response = await fetch("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive", {
method: "POST",
headers: {
"X-API-Key": process.env.WAPIMAX_API_KEY,
"Content-Type": "application/json",
"Accept": "application/json"
},
body: JSON.stringify({
to: "254712345678@s.whatsapp.net",
body_text: "Choose an option to continue.",
footer_text: "WapiMax Interactive",
buttons: [
{ name: "quick_reply", button_params_json: '{"display_text":"Get Started","id":"get_started"}' },
{ name: "quick_reply", button_params_json: '{"display_text":"Contact Support","id":"contact_support"}' }
]
})
});
if (!response.ok) {
throw new Error(`Request failed with status ${response.status}`);
}
console.log(await response.json());
<?php
$curl = curl_init();
$payload = json_encode([
"to" => "254712345678@s.whatsapp.net",
"body_text" => "Choose an option to continue.",
"footer_text" => "WapiMax Interactive",
"buttons" => [
["name" => "quick_reply", "button_params_json" => '{"display_text":"Get Started","id":"get_started"}'],
["name" => "quick_reply", "button_params_json" => '{"display_text":"Contact Support","id":"contact_support"}']
]
]);
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
CURLOPT_HTTPHEADER => [
"X-API-Key: YOUR_API_KEY",
"Content-Type: application/json",
"Accept: application/json"
]
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.post(
"https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/json"
},
json={
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
{"name": "quick_reply", "button_params_json": '{"display_text":"Get Started","id":"get_started"}'},
{"name": "quick_reply", "button_params_json": '{"display_text":"Contact Support","id":"contact_support"}'}
]
}
)
print(response.json())
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = """
{
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
{"name": "quick_reply", "button_params_json": "{\\"display_text\\":\\"Get Started\\",\\"id\\":\\"get_started\\"}"},
{"name": "quick_reply", "button_params_json": "{\\"display_text\\":\\"Contact Support\\",\\"id\\":\\"contact_support\\"}"}
]
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(
request,
HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
jsonBody := []byte(`{
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Get Started\",\"id\":\"get_started\"}"},
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Contact Support\",\"id\":\"contact_support\"}"}
]
}`)
req, _ := http.NewRequest(
"POST",
"https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive",
bytes.NewBuffer(jsonBody),
)
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
require "net/http"
require "uri"
require "json"
uri = URI("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive")
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = "YOUR_API_KEY"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request.body = {
to: "254712345678@s.whatsapp.net",
body_text: "Choose an option to continue.",
footer_text: "WapiMax Interactive",
buttons: [
{ name: "quick_reply", button_params_json: '{"display_text":"Get Started","id":"get_started"}' },
{ name: "quick_reply", button_params_json: '{"display_text":"Contact Support","id":"contact_support"}' }
]
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
puts response.body
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var payload = new
{
to = "254712345678@s.whatsapp.net",
body_text = "Choose an option to continue.",
footer_text = "WapiMax Interactive",
buttons = new[]
{
new { name = "quick_reply", button_params_json = "{\"display_text\":\"Get Started\",\"id\":\"get_started\"}" },
new { name = "quick_reply", button_params_json = "{\"display_text\":\"Contact Support\",\"id\":\"contact_support\"}" }
}
};
var content = new StringContent(
JsonSerializer.Serialize(payload),
Encoding.UTF8,
"application/json"
);
var response = await client.PostAsync(
"https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive",
content
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
import Foundation
let url = URL(string: "https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-API-Key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("application/json", forHTTPHeaderField: "Accept")
let body: [String: Any] = [
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
["name": "quick_reply", "button_params_json": "{\"display_text\":\"Get Started\",\"id\":\"get_started\"}"],
["name": "quick_reply", "button_params_json": "{\"display_text\":\"Contact Support\",\"id\":\"contact_support\"}"]
]
]
request.httpBody = try? JSONSerialization.data(withJSONObject: body)
URLSession.shared.dataTask(with: request) { data, _, error in
if let error = error {
print(error)
return
}
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
}.resume()
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
fun main() {
val client = OkHttpClient()
val json = """
{
"to": "254712345678@s.whatsapp.net",
"body_text": "Choose an option to continue.",
"footer_text": "WapiMax Interactive",
"buttons": [
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Get Started\",\"id\":\"get_started\"}"},
{"name": "quick_reply", "button_params_json": "{\"display_text\":\"Contact Support\",\"id\":\"contact_support\"}"}
]
}
""".trimIndent()
val request = Request.Builder()
.url("https://api.wapimax.com/whatsapp/v1/sessions/YOUR_SESSION_ID/messages/interactive")
.post(json.toRequestBody("application/json".toMediaType()))
.addHeader("X-API-Key", "YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build()
client.newCall(request).execute().use { response ->
println(response.body?.string())
}
}
Response
{
"status": "sent",
"message_id": "3EB0C8F1A2B3C4D5E6",
"timestamp": 1794304083,
"to": "254712345678@s.whatsapp.net"
}
{
"status": "pending",
"schedule_id": "b3f1c2a4-1234-4cde-9f00-abcdef123456",
"send_at": "2026-12-01T12:00:00Z"
}
Response fields
| Field | Type | Description |
|---|---|---|
status | string | sent or pending |
message_id | string | Sent message ID |
timestamp | integer | Sent time (Unix) |
to | string | Recipient ID |
schedule_id | string | Scheduled message ID |
send_at | string | Scheduled send time |
Errors
| Status | Description |
|---|---|
400 | Invalid request or parameters |
401 | Missing or invalid API key |
403 | Access to this session is not allowed |
404 | Session or resource not found |
429 | Rate limit or quota exceeded |
503 | Session is not connected |