Get recipient JSON schema for a template
curl --request GET \
--url https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload', 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.otpiq.com/api/whatsapp/campaigns/recipient-payload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"template": {
"id": "<string>",
"name": "<string>",
"language": "<string>"
},
"fields": [
{
"key": "1",
"label": "Body {{1}}",
"required": true,
"example": "<string>",
"templateParametersPath": "templateParameters.body.1"
}
],
"exampleRecipient": {
"phoneNumber": "9647712345678",
"templateParameters": {
"body": {},
"header": {},
"buttons": {}
}
}
}
}{
"success": false,
"error": "Recipients cannot exceed 1000 per request"
}{
"message": "Unauthorized, please use your project api key"
}{
"success": false,
"error": "<string>",
"unsupportedPhoneNumbers": [
"<string>"
]
}{
"success": false,
"error": "Campaign not found"
}WhatsApp Campaigns Endpoints
Get Recipient Schema
Get the required JSON schema for building the recipient payload for a specific template
GET
/
whatsapp
/
campaigns
/
recipient-payload
Get recipient JSON schema for a template
curl --request GET \
--url https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload', 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.otpiq.com/api/whatsapp/campaigns/recipient-payload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/whatsapp/campaigns/recipient-payload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"template": {
"id": "<string>",
"name": "<string>",
"language": "<string>"
},
"fields": [
{
"key": "1",
"label": "Body {{1}}",
"required": true,
"example": "<string>",
"templateParametersPath": "templateParameters.body.1"
}
],
"exampleRecipient": {
"phoneNumber": "9647712345678",
"templateParameters": {
"body": {},
"header": {},
"buttons": {}
}
}
}
}{
"success": false,
"error": "Recipients cannot exceed 1000 per request"
}{
"message": "Unauthorized, please use your project api key"
}{
"success": false,
"error": "<string>",
"unsupportedPhoneNumbers": [
"<string>"
]
}{
"success": false,
"error": "Campaign not found"
}Use this endpoint to understand the exact shape of the
templateParameters required for your chosen template before attaching recipients.Authorizations
Project API key (sk_live… or sk_dev…). Send it as Authorization: Bearer <api_key>.
Query Parameters
MongoDB template id from GET /api/whatsapp/resources
Pattern:
^[a-fA-F0-9]{24}$Campaign MongoDB id (uses the campaign's linked template)
Pattern:
^[a-fA-F0-9]{24}$Alias for _id (campaign MongoDB id)
Pattern:
^[a-fA-F0-9]{24}$⌘I