Send WhatsApp Interactive URL Button Message
curl --request POST \
--url https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"recipient": "<string>",
"phone_id": "<string>",
"interactive": {
"type": "<string>",
"header": {},
"body": {},
"footer": {},
"action": {}
},
"post_back_url": "<string>",
"post_back_data": "<string>"
}
'import requests
url = "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send"
payload = {
"recipient": "<string>",
"phone_id": "<string>",
"interactive": {
"type": "<string>",
"header": {},
"body": {},
"footer": {},
"action": {}
},
"post_back_url": "<string>",
"post_back_data": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
recipient: '<string>',
phone_id: '<string>',
interactive: {type: '<string>', header: {}, body: JSON.stringify({}), footer: {}, action: {}},
post_back_url: '<string>',
post_back_data: '<string>'
})
};
fetch('https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipient' => '<string>',
'phone_id' => '<string>',
'interactive' => [
'type' => '<string>',
'header' => [
],
'body' => [
],
'footer' => [
],
'action' => [
]
],
'post_back_url' => '<string>',
'post_back_data' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send"
payload := strings.NewReader("{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "WhatsApp request queued successfully",
"request_id": "f8df74d1-11fa-4485-b164-b9a65358f4fc"
}
Interactive Messages
Send WhatsApp Interactive URL Button Message
Send an interactive URL button message via WhatsApp
POST
/
api
/
ingest
/
whatsapp
/
v1
/
message
/
interactive
/
url-button
/
send
Send WhatsApp Interactive URL Button Message
curl --request POST \
--url https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"recipient": "<string>",
"phone_id": "<string>",
"interactive": {
"type": "<string>",
"header": {},
"body": {},
"footer": {},
"action": {}
},
"post_back_url": "<string>",
"post_back_data": "<string>"
}
'import requests
url = "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send"
payload = {
"recipient": "<string>",
"phone_id": "<string>",
"interactive": {
"type": "<string>",
"header": {},
"body": {},
"footer": {},
"action": {}
},
"post_back_url": "<string>",
"post_back_data": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-workspace-id": "<x-workspace-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-workspace-id': '<x-workspace-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
recipient: '<string>',
phone_id: '<string>',
interactive: {type: '<string>', header: {}, body: JSON.stringify({}), footer: {}, action: {}},
post_back_url: '<string>',
post_back_data: '<string>'
})
};
fetch('https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipient' => '<string>',
'phone_id' => '<string>',
'interactive' => [
'type' => '<string>',
'header' => [
],
'body' => [
],
'footer' => [
],
'action' => [
]
],
'post_back_url' => '<string>',
'post_back_data' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send"
payload := strings.NewReader("{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send")
.header("x-api-key", "<x-api-key>")
.header("x-workspace-id", "<x-workspace-id>")
.header("Content-Type", "application/json")
.body("{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-ai.zixflow.com/api/ingest/whatsapp/v1/message/interactive/url-button/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipient\": \"<string>\",\n \"phone_id\": \"<string>\",\n \"interactive\": {\n \"type\": \"<string>\",\n \"header\": {},\n \"body\": {},\n \"footer\": {},\n \"action\": {}\n },\n \"post_back_url\": \"<string>\",\n \"post_back_data\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "WhatsApp request queued successfully",
"request_id": "f8df74d1-11fa-4485-b164-b9a65358f4fc"
}
Description
This endpoint allows you to send an interactive URL button message via WhatsApp. Users can tap a button to open a URL.Headers
string
required
Your API key for authentication.
string
required
Your workspace ID for authentication.
Body
string
required
The recipient’s phone number in international format. Must include the country code without the leading plus sign (+) or any spaces, dashes, or other special characters. Format: country code followed by the phone number. Example:
919876543210 (India: country code 91 + number 9876543210).string
required
The unique Phone ID associated with your WhatsApp Business account. You can find this on the Zixflow WhatsApp Settings page or by calling the Get WhatsApp Accounts endpoint.
object
required
Interactive URL button message object containing header, body, footer, and action.
Hide interactive
Hide interactive
string
required
Type of interactive message. Use “button” for URL button messages.
object
Optional header object with type and text/image/video/document.
object
required
Body object with text content.
object
Optional footer object with text.
object
required
Action object containing buttons array. Each button has type (url) and contains url object with url.
string
(Optional) To receive post-back notifications about the sent message as it is delivered or failed. When a message status changes (delivered, failed, etc.), a notification will be sent to this URL. See Postback Notifications for the payload format and field descriptions.
string
(Optional) The data that will be sent back on the post_back_url with the notification. This can be used as an identifier for the sent message if the client wants to track or correlate messages with their own system. See Postback Notifications for how it appears in the notification.
Response
boolean
Indicates whether the request was successful. true if the request was accepted and queued, false otherwise.
string
Success message when the request succeeded, or error message when it failed.
string
Present only when success is true. Unique identifier for this request; use it for tracking and for correlating with postback notifications.
{
"success": true,
"message": "WhatsApp request queued successfully",
"request_id": "f8df74d1-11fa-4485-b164-b9a65358f4fc"
}