Send Transactional Message
curl --request POST \
--url https://otpedge.com/api/v1/send-message \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"template": "<string>",
"language": "<string>",
"variables": {
"header": {},
"body": {},
"button": {}
}
}
'import requests
url = "https://otpedge.com/api/v1/send-message"
payload = {
"to": "<string>",
"template": "<string>",
"language": "<string>",
"variables": {
"header": {},
"body": {},
"button": {}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
template: '<string>',
language: '<string>',
variables: {header: {}, body: JSON.stringify({}), button: {}}
})
};
fetch('https://otpedge.com/api/v1/send-message', 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://otpedge.com/api/v1/send-message",
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([
'to' => '<string>',
'template' => '<string>',
'language' => '<string>',
'variables' => [
'header' => [
],
'body' => [
],
'button' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://otpedge.com/api/v1/send-message"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://otpedge.com/api/v1/send-message")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otpedge.com/api/v1/send-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"req_id": "msg_a1b2c3d4e5f6",
"status": "dispatched",
"template": "invoice_receipt"
}
{
"error": "Configuration Error: No Meta WhatsApp integration found for this workspace."
}
API Endpoints
Send Transactional Message
Dispatches a transactional WhatsApp message (like Invoice PDFs or Account Alerts) with dynamic variables and attachments.
POST
/
api
/
v1
/
send-message
Send Transactional Message
curl --request POST \
--url https://otpedge.com/api/v1/send-message \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"template": "<string>",
"language": "<string>",
"variables": {
"header": {},
"body": {},
"button": {}
}
}
'import requests
url = "https://otpedge.com/api/v1/send-message"
payload = {
"to": "<string>",
"template": "<string>",
"language": "<string>",
"variables": {
"header": {},
"body": {},
"button": {}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
template: '<string>',
language: '<string>',
variables: {header: {}, body: JSON.stringify({}), button: {}}
})
};
fetch('https://otpedge.com/api/v1/send-message', 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://otpedge.com/api/v1/send-message",
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([
'to' => '<string>',
'template' => '<string>',
'language' => '<string>',
'variables' => [
'header' => [
],
'body' => [
],
'button' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://otpedge.com/api/v1/send-message"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://otpedge.com/api/v1/send-message")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otpedge.com/api/v1/send-message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"template\": \"<string>\",\n \"language\": \"<string>\",\n \"variables\": {\n \"header\": {},\n \"body\": {},\n \"button\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"req_id": "msg_a1b2c3d4e5f6",
"status": "dispatched",
"template": "invoice_receipt"
}
{
"error": "Configuration Error: No Meta WhatsApp integration found for this workspace."
}
Request Body
string
required
The recipient’s phone number in strict E.164 format (e.g.,
+919876543210).string
required
The exact name of the WhatsApp template you created in your Meta Business account (e.g.,
invoice_receipt).string
The language code of the template. Defaults to
en_US.object
An object containing the dynamic data to inject into the template.
Show properties
Show properties
object
Used if your template has a media header (Document, Image, or Video).
type: Must betext,document,image, orvideo.link: The absolute URL to the media file (required for media types).filename: The name of the file to display (e.g.,invoice.pdf).text: The text content (if type istext).
array of strings
An array of strings corresponding to the
{{1}}, {{2}} placeholders in your template body.array of strings
An array of strings to inject into dynamic URL buttons.
Request Examples
curl -X POST https://otpedge.com/api/v1/send-message \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"template": "invoice_receipt",
"language": "en_US",
"variables": {
"header": {
"type": "document",
"link": "https://your-site.com/invoices/INV-123.pdf",
"filename": "Monthly_Invoice.pdf"
},
"body": [
"John Doe",
"$49.99"
],
"button": [
"INV-123"
]
}
}'
const response = await fetch('https://otpedge.com/api/v1/send-message', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: "+919876543210",
template: "invoice_receipt",
language: "en_US",
variables: {
header: {
type: "document",
link: "https://your-site.com/invoices/INV-123.pdf",
filename: "Monthly_Invoice.pdf"
},
body: ["John Doe", "$49.99"],
button: ["INV-123"]
}
})
});
const data = await response.json();
console.log(data);
Response Examples
{
"success": true,
"req_id": "msg_a1b2c3d4e5f6",
"status": "dispatched",
"template": "invoice_receipt"
}
{
"error": "Configuration Error: No Meta WhatsApp integration found for this workspace."
}
⌘I