Introduction
The Dining Club WABA API follows RESTful architecture standards, offering clear and consistent resource-based endpoints. All requests and responses are transmitted in JSON format, leveraging standard HTTP verbs, status codes, and authentication protocols to enable secure, efficient, and scalable integrations.
API Base URL
Please note that Dining Club WABA does not provide a sandbox or test environment. All API requests are processed in the live environment, so ensure that all request data and parameters are accurate before making any calls.
https://waba.dinningclub.in/external-api
Authentication
All requests to the Dining Club WABA API require authentication. Each API request must include a valid client-id and client-secret to the request header, which can be obtained from your Dining Club WABA Dashboard under Developer Tools.
In addition to credentials, Dining Club WABA enforces IP-based security. You must register and enable your server’s public IP address in the IP Whitelist section of the dashboard. Requests originating from non-whitelisted IP addresses will be automatically rejected.
Both valid API credentials and an approved IP address are mandatory. Without completing these two steps, authentication will fail and API access will not be granted.
Response Format
All responses from the Dining Club WABA API are returned in JSON format. Each response follows a consistent structure and includes a status indicator, message, and relevant data payload when applicable. Standard HTTP status codes are used to represent the outcome of each request.
Sample Success Response
{
"status": "success",
"remark": "contact_list",
"message":[
"Contact list fetched successfully"
],
"data": {
...you get all data here
}
}
Error Sample Response
{
"remark": "Unauthorized",
"status": "error",
"message": [
"The client secret is required"
]
}
{
"remark": "Unauthorized",
"status": "error",
"message": [
"Access to this API endpoint is restricted to IP addresses that have been explicitly whitelisted.",
"In order to access this API endpoint, please add your IP address (::1) to the white list from the user dashboard."
]
}
GET /external-api/contact/list HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
curl -X GET "' . $externalAPiBaseURL . '/contact/list" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/contact/list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/contact/list');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/contact/list');
$request->setRequestMethod('GET');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', '' . $externalAPiBaseURL . '/contact/list', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("GET", "/external-api/contact/list", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
url = "' . $externalAPiBaseURL . '/contact/list"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.get(url, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('' . $externalAPiBaseURL . '/contact/list');
final response = await http.get(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "' . $externalAPiBaseURL . '/contact/list", nil)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/contact/list"))
.GET()
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/contact/list", {
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
});
const data = await response.json();
console.log(data);
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/contact/list",
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Get Contact List
This endpoint allows you to retrieve a complete list of contacts associated with your Dining Club WABA account.
Query Parameters
Query parameters that allow you to customize the API response.
| Name | Description | Required | Default |
|---|---|---|---|
page |
Specifies the page number to retrieve. | No | 1 |
paginate |
Defines the number of items returned per page. | No | 20 |
search |
Searches for contacts by firstname, lastname or mobile number. | No | - |
POST /external-api/contact/store HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
firstname=John&lastname=Doe&mobile_code=880&mobile=9999999999
curl -X POST "' . $externalAPiBaseURL . '/contact/store" \
-d "firstname=John" \
-d "lastname=Doe" \
-d "mobile_code=880" \
-d "mobile=9999999999" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/contact/store',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/contact/store');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/contact/store');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/contact/store', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/contact/store", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}
url = "' . $externalAPiBaseURL . '/contact/store"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'firstname': 'John',
'lastname': 'Doe',
'mobile_code': '880',
'mobile': '9999999999',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/contact/store');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"firstname": {"John"},
"lastname": {"Doe"},
"mobile_code": {"880"},
"mobile": {"9999999999"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/contact/store", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "firstname=John&lastname=Doe&mobile_code=880&mobile=9999999999";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/contact/store"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/contact/store", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/contact/store",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Create New Contact
This endpoint allows you to add a new contact to your Dining Club WABA account. Provide the necessary contact details, and upon successful request, the API returns the created contact’s information in JSON format for easy integration.
Required Fields
The following fields are required to create a new contact in the system.
| Name | Required | Default |
|---|---|---|
firstname |
Yes | - |
lastname |
Yes | - |
mobile_code |
Yes | - |
mobile |
Yes | - |
city |
No | - |
state |
No | - |
post_code |
No | - |
address |
No | - |
profile_image |
No | - |
POST /external-api/contact/update/{contactId} HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
firstname=John&lastname=Doe&mobile_code=880&mobile=9999999999
curl -X POST "' . $externalAPiBaseURL . '/contact/update/{contactId}" \
-d "firstname=John" \
-d "lastname=Doe" \
-d "mobile_code=880" \
-d "mobile=9999999999" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$contactId = 1;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/contact/update/{contactId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$contactId = 1;
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/contact/update/{contactId}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$contactId = 1;
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/contact/update/{contactId}');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$contactId = 1;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/contact/update/{contactId}', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'firstname' => 'John',
'lastname' => 'Doe',
'mobile_code' => '880',
'mobile' => '9999999999',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
$contactId = 1;
conn.request("POST", "/external-api/contact/update/{contactId}", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}
url = "' . $externalAPiBaseURL . '/contact/update/{contactId}"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'firstname': 'John',
'lastname': 'Doe',
'mobile_code': '880',
'mobile': '9999999999',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/contact/update/{contactId}');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"firstname": {"John"},
"lastname": {"Doe"},
"mobile_code": {"880"},
"mobile": {"9999999999"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/contact/update/{contactId}", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "firstname=John&lastname=Doe&mobile_code=880&mobile=9999999999";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/contact/update/{contactId}"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/contact/update/{contactId}", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"firstname": "John",
"lastname": "Doe",
"mobile_code": "880",
"mobile": "9999999999",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/contact/update/{contactId}",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Update Contact
This endpoint allows you to update an existing contact. You only need to send the fields you want to modify. Any field not included in the request will remain unchanged.
Required Fields
The following fields are required to create a new contact in the system.
| Name | Required | Default |
|---|---|---|
firstname |
Yes | - |
lastname |
Yes | - |
mobile_code |
Yes | - |
mobile |
Yes | - |
city |
No | - |
state |
No | - |
post_code |
No | - |
address |
No | - |
profile_image |
No | - |
DELETE /external-api/contact/delete/{contactId} HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
curl -X DELETE "' . $externalAPiBaseURL . '/contact/delete/{contactId}" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$contactId = 1;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/contact/delete/{contactId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$contactId = 1;
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/contact/delete/{contactId}');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$response = $request->send();
echo $response->getBody();
$contactId = 1;
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/contact/delete/{contactId}');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$contactId = 1;
$client = new Client();
$response = $client->request('DELETE', '' . $externalAPiBaseURL . '/contact/delete/{contactId}', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
$contactId = 1;
conn.request("DELETE", "/external-api/contact/delete/{contactId}", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
url = "' . $externalAPiBaseURL . '/contact/delete/{contactId}"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.delete(url, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('' . $externalAPiBaseURL . '/contact/delete/{contactId}');
final response = await http.delete(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "' . $externalAPiBaseURL . '/contact/delete/{contactId}", nil)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/contact/delete/{contactId}"))
.DELETE()
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/contact/delete/{contactId}", {
method: "DELETE",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
});
const data = await response.json();
console.log(data);
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/contact/delete/{contactId}",
method: "DELETE",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Delete Contact
This endpoint allows you to delete a contact by its unique ID. Deletion may be restricted if the contact has associated messages or is blocked.
GET /external-api/inbox/conversation-list HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
curl -X GET "' . $externalAPiBaseURL . '/inbox/conversation-list" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/conversation-list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/conversation-list');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/conversation-list');
$request->setRequestMethod('GET');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', '' . $externalAPiBaseURL . '/inbox/conversation-list', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
]);
echo $response->getBody()->getContents();
import http.client
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("GET", "/external-api/inbox/conversation-list", headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
url = "' . $externalAPiBaseURL . '/inbox/conversation-list"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.get(url, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/conversation-list');
final response = await http.get(url, headers: {
'client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',
});
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "' . $externalAPiBaseURL . '/inbox/conversation-list", nil)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.io.*;
import java.net.*;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/conversation-list"))
.GET()
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/conversation-list", {
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
});
const data = await response.json();
console.log(data);
const https = require("https");
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/conversation-list",
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Conversation List
Retrieve a paginated list of conversations for the authenticated user, including contact info and conversation status.
Query Parameters
| Name | Description | Default |
|---|---|---|
status |
Filter by status. Done = 1, Pending = 2, Important = 3, Unread = 4 | All |
page |
Page number to retrieve. | 1 |
paginate |
Number of items per page. | 20 |
POST /external-api/inbox/change-conversation-status/{conversationId} HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
status=1
curl -X POST "' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}" \
-d "status=1" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$conversationId = 2;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'status' => '1',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$conversationId = 2;
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'status' => '1',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$conversationId = 2;
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'status' => '1',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$conversationId = 2;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'status' => '1',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"status": "1",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
$conversationId = 2;
conn.request("POST", "/external-api/inbox/change-conversation-status/{conversationId}", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"status": "1",
}
url = "' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'status': '1',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"status": {"1"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "status=1";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/change-conversation-status/{conversationId}", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"status": "1",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"status": "1",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/change-conversation-status/{conversationId}",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Change Conversation Status
Update the status of a conversation such as pending, done, or important. Here Done = 1, Pending = 2 and Important = 3,UnRead=4
URL Parameters
| Parameter | Type | Description |
|---|---|---|
conversation_id |
integer | Unique ID of the conversation |
Request Body
| Field | Type | Required |
|---|---|---|
status |
integer | YEs |
GET /external-api/inbox/conversation-details/{conversationId} HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
curl -X GET "' . $externalAPiBaseURL . '/inbox/conversation-details/{conversationId}" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$conversationId = 2;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/conversation-details/' . $conversationId,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$conversationId = 2;
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/conversation-details/' . $conversationId);
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$response = $request->send();
echo $response->getBody();
$conversationId = 2;
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/conversation-details/' . $conversationId);
$request->setRequestMethod('GET');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$conversationId = 2;
$client = new Client();
$response = $client->request('GET', "' . $externalAPiBaseURL . '/inbox/conversation-details/{$conversationId}", [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
]);
echo $response->getBody()->getContents();
import http.client
conversation_id = 2
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("GET", f"/external-api/inbox/conversation-details/{conversation_id}", headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
conversation_id = 2
url = f"' . $externalAPiBaseURL . '/inbox/conversation-details/{conversation_id}"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.get(url, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
const conversationId = 2;
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/conversation-details/$conversationId');
final response = await http.get(url, headers: {
'client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',
});
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
conversationId := 2
url := fmt.Sprintf("' . $externalAPiBaseURL . '/inbox/conversation-details/%d", conversationId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.*;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
int conversationId = 2;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/conversation-details/" + conversationId))
.GET()
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const conversationId = 2;
const response = await fetch(`' . $externalAPiBaseURL . '/inbox/conversation-details/${conversationId}`, {
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
});
const data = await response.json();
console.log(data);
const https = require("https");
const conversationId = 2;
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: `/external-api/inbox/conversation-details/${conversationId}`,
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Conversation Details
Retrieve complete details of a conversation including contact information, notes, tags, and list associations.
URL Parameters
| Parameter | Type | Description |
|---|---|---|
conversation_id |
integer | Unique ID of the conversation |
POST /external-api/inbox/send-message HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
mobile_code=880&mobile=9999999999&message=Hello world
curl -X POST "' . $externalAPiBaseURL . '/inbox/send-message" \
-d "mobile_code=880" \
-d "mobile=9999999999" \
-d "message=Hello world" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/send-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '880',
'mobile' => '9999999999',
'message' => 'Hello world',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/send-message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'mobile_code' => '880',
'mobile' => '9999999999',
'message' => 'Hello world',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/send-message');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'mobile_code' => '880',
'mobile' => '9999999999',
'message' => 'Hello world',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/send-message', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'mobile_code' => '880',
'mobile' => '9999999999',
'message' => 'Hello world',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"mobile_code": "880",
"mobile": "9999999999",
"message": "Hello world",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/inbox/send-message", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"mobile_code": "880",
"mobile": "9999999999",
"message": "Hello world",
}
url = "' . $externalAPiBaseURL . '/inbox/send-message"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'mobile_code': '880',
'mobile': '9999999999',
'message': 'Hello world',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/send-message');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"mobile_code": {"880"},
"mobile": {"9999999999"},
"message": {"Hello world"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/send-message", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "mobile_code=880&mobile=9999999999&message=Hello world";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/send-message"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/send-message", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"mobile_code": "880",
"mobile": "9999999999",
"message": "Hello world",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"mobile_code": "880",
"mobile": "9999999999",
"message": "Hello world",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/send-message",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Send Message
Send WhatsApp messages to a mobile number. This endpoint supports text, media, location, interactive lists, CTA URLs, and e-commerce messages. If no existing contact or conversation is found for the provided phone number, a new contact and conversation will be created automatically.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mobile_code |
string | yes | Mobile country code. Must be a valid numeric country code without the plus (+) sign. |
mobile |
string | yes | A valid mobile phone number associated with the provided country code. |
from_number |
string | conditional | A valid WhatsApp Business phone number registered on your account and in the Meta dashboard is required. If no ID is provided, the message will be sent using your default registered WhatsApp account. |
message |
string | Conditional | Text message body. Required if no media, location, or interactive data is provided |
image |
file | No | Image file (jpg, jpeg, png – max 5MB) |
document |
file | No | Document file (pdf, doc, docx – max 100MB) |
video |
file | No | Video file (mp4 – max 16MB) |
audio |
file | No | Audio file – max 16MB |
latitude |
decimal | Conditional | Latitude for location message |
longitude |
decimal | Conditional | Longitude for location message |
cta_url_id |
integer | No | CTA URL ID for interactive button messages |
interactive_list_id |
integer | No | Interactive list ID |
Notes
At least one message type must be provided.
Interactive messages require an active plan.
Blocked contacts cannot send or receive messages.
POST /external-api/inbox/send-template-message HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
mobile_code=880&mobile=9999999999&template_id=your_template_id&body_variables[0]=John&body_variables[1]=Order #1234
curl -X POST "' . $externalAPiBaseURL . '/inbox/send-template-message" \
-d "mobile_code=880" \
-d "mobile=9999999999" \
-d "template_id=your_template_id" \
-d "body_variables[0]=John" \
-d "body_variables[1]=Order #1234" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/send-template-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '880',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'mobile_code' => '880',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'mobile_code' => '880',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/send-template-message', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'mobile_code' => '880',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"mobile_code": "880",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/inbox/send-template-message", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"mobile_code": "880",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}
url = "' . $externalAPiBaseURL . '/inbox/send-template-message"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'mobile_code': '880',
'mobile': '9999999999',
'template_id': 'your_template_id',
'body_variables[0]': 'John',
'body_variables[1]': 'Order #1234',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/send-template-message');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"mobile_code": {"880"},
"mobile": {"9999999999"},
"template_id": {"your_template_id"},
"body_variables[0]": {"John"},
"body_variables[1]": {"Order #1234"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/send-template-message", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "mobile_code=880&mobile=9999999999&template_id=your_template_id&body_variables[0]=John&body_variables[1]=Order #1234";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/send-template-message"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/send-template-message", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"mobile_code": "880",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"mobile_code": "880",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/send-template-message",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Send Simple Template Message
Send an approved WhatsApp template message with plain text body variables. Use this for basic notification templates that do not include media headers or payment buttons.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mobile_code |
string | Yes | Mobile country code without the plus (+) sign (e.g. 880 for Bangladesh, 91 for India). |
mobile |
string | Yes | Recipient mobile number without country code. Digits only. |
template_id |
string | Yes | Approved WhatsApp template ID (the WhatsApp template ID, not the internal database ID). |
from_number |
string | No | WhatsApp Business phone number to send from. Defaults to your primary account if omitted. |
Notes
Only approved WhatsApp templates can be sent.
Template messages are used for business-initiated conversations (outside the 24-hour customer service window).
Blocked contacts cannot receive template messages.
Body variables must be provided in the same order as the placeholders appear in the template.
To send a template with an image, video, or document header, see "Send Template Message (With Header)" below.
To send a template with a WhatsApp Pay / Order Details button, see "Send Template Message (Order Details)" below.
POST /external-api/inbox/send-template-message HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
mobile_code=91&mobile=9999999999&template_id=your_template_id&header_media_url=https://example.com/promo-banner.jpg&header_media_type=image
curl -X POST "' . $externalAPiBaseURL . '/inbox/send-template-message" \
-d "mobile_code=91" \
-d "mobile=9999999999" \
-d "template_id=your_template_id" \
-d "header_media_url=https://example.com/promo-banner.jpg" \
-d "header_media_type=image" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/send-template-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/send-template-message', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/inbox/send-template-message", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
}
url = "' . $externalAPiBaseURL . '/inbox/send-template-message"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'mobile_code': '91',
'mobile': '9999999999',
'template_id': 'your_template_id',
'header_media_url': 'https://example.com/promo-banner.jpg',
'header_media_type': 'image',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/send-template-message');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"mobile_code": {"91"},
"mobile": {"9999999999"},
"template_id": {"your_template_id"},
"header_media_url": {"https://example.com/promo-banner.jpg"},
"header_media_type": {"image"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/send-template-message", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "mobile_code=91&mobile=9999999999&template_id=your_template_id&header_media_url=https://example.com/promo-banner.jpg&header_media_type=image";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/send-template-message"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/send-template-message", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/send-template-message",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Send Template Message (With Header)
Send an approved WhatsApp template message that includes a media header — image, video, or document. Use this when your template header type is IMAGE, VIDEO, or DOCUMENT and you want to supply the media from a public URL instead of the default file uploaded during template creation.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mobile_code |
string | Yes | Mobile country code without the plus (+) sign (e.g. 880 for Bangladesh, 91 for India). |
mobile |
string | Yes | Recipient mobile number without country code. Digits only. |
template_id |
string | Yes | Approved WhatsApp template ID. |
from_number |
string | No | WhatsApp Business phone number to send from. Defaults to your primary account if omitted. |
header_media_url |
string (URL) | Yes | Publicly accessible URL for the header media file. Must be reachable by the WhatsApp Cloud API servers. Supports JPG/PNG for images, MP4 for videos, and PDF/DOC/DOCX for documents. |
header_media_type |
string | Yes | Type of header media. Accepted values: image, video, document. |
header_media_filename |
string | No | Custom display filename for document headers (e.g. "Invoice-1234.pdf"). Only applicable when header_media_type is document. If omitted, the filename is derived from the URL. |
Supported Media Types
| header_media_type | Accepted Formats | Max Size |
|---|---|---|
image |
JPG, JPEG, PNG | 5 MB |
video |
MP4 | 16 MB |
document |
PDF, DOC, DOCX | 100 MB |
Notes
The template header format must be IMAGE, VIDEO, or DOCUMENT for the header_media_url to be applied.
The media URL must be publicly accessible — private or localhost URLs will not work.
If header_media_url is not provided, the default media uploaded during template creation will be used.
For document headers, providing header_media_filename gives the recipient a meaningful filename instead of a random string.
Blocked contacts cannot receive template messages.
POST /external-api/inbox/send-template-message HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
mobile_code=91&mobile=9999999999&template_id=your_template_id&from_number=YOUR_WHATSAPP_PHONE_NUMBER_ID&header_media_url=https://example.com/promo-banner.jpg&header_media_type=image&body_variables[0]=John&body_variables[1]=Order #1234
curl -X POST "' . $externalAPiBaseURL . '/inbox/send-template-message" \
-d "mobile_code=91" \
-d "mobile=9999999999" \
-d "template_id=your_template_id" \
-d "from_number=YOUR_WHATSAPP_PHONE_NUMBER_ID" \
-d "header_media_url=https://example.com/promo-banner.jpg" \
-d "header_media_type=image" \
-d "body_variables[0]=John" \
-d "body_variables[1]=Order #1234" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/send-template-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'from_number' => 'YOUR_WHATSAPP_PHONE_NUMBER_ID',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'from_number' => 'YOUR_WHATSAPP_PHONE_NUMBER_ID',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'from_number' => 'YOUR_WHATSAPP_PHONE_NUMBER_ID',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/send-template-message', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'from_number' => 'YOUR_WHATSAPP_PHONE_NUMBER_ID',
'header_media_url' => 'https://example.com/promo-banner.jpg',
'header_media_type' => 'image',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"from_number": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/inbox/send-template-message", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"from_number": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}
url = "' . $externalAPiBaseURL . '/inbox/send-template-message"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'mobile_code': '91',
'mobile': '9999999999',
'template_id': 'your_template_id',
'from_number': 'YOUR_WHATSAPP_PHONE_NUMBER_ID',
'header_media_url': 'https://example.com/promo-banner.jpg',
'header_media_type': 'image',
'body_variables[0]': 'John',
'body_variables[1]': 'Order #1234',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/send-template-message');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"mobile_code": {"91"},
"mobile": {"9999999999"},
"template_id": {"your_template_id"},
"from_number": {"YOUR_WHATSAPP_PHONE_NUMBER_ID"},
"header_media_url": {"https://example.com/promo-banner.jpg"},
"header_media_type": {"image"},
"body_variables[0]": {"John"},
"body_variables[1]": {"Order #1234"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/send-template-message", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "mobile_code=91&mobile=9999999999&template_id=your_template_id&from_number=YOUR_WHATSAPP_PHONE_NUMBER_ID&header_media_url=https://example.com/promo-banner.jpg&header_media_type=image&body_variables[0]=John&body_variables[1]=Order #1234";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/send-template-message"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/send-template-message", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"from_number": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"from_number": "YOUR_WHATSAPP_PHONE_NUMBER_ID",
"header_media_url": "https://example.com/promo-banner.jpg",
"header_media_type": "image",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/send-template-message",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Send Template Message (With Header Media and Body)
Send an approved WhatsApp template message when your template header is IMAGE/VIDEO/DOCUMENT (use header_media_*) and the template body contains variables (use body_variables[]).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mobile_code |
string | Yes | Mobile country code without the plus (+) sign (e.g. 91 for India). |
mobile |
string | Yes | Recipient mobile number without country code. Digits only. |
template_id |
string | Yes | Approved WhatsApp template ID (the WhatsApp template ID). |
from_number |
string | No | WhatsApp Business phone number to send from. Defaults to your primary account if omitted. |
header_media_url |
string (URL) | Yes | Publicly accessible URL for the header media file (image/video/document). |
header_media_type |
string | Yes | Type of header media. Accepted values: image, video, document. |
header_media_filename |
string | No | Custom display filename for document headers (e.g. "Invoice-1234.pdf"). Optional. |
body_variables[] |
array | conditional | Ordered array of values for body placeholder variables. body_variables[0] maps to , body_variables[1] to , etc. |
Notes
Use this section when your template header is of type IMAGE/VIDEO/DOCUMENT and you want to provide header_media_url/header_media_type along with body_variables[].
If your template header is TEXT with placeholders, you can still pass header_variables[] to the same endpoint (send-template-message).
For payment/order details templates with an ORDER_DETAILS button, use "Send Template Message (Order Tracking)".
Blocked contacts cannot receive template messages.
POST /external-api/inbox/send-template-message HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
Content-Type: application/x-www-form-urlencoded
mobile_code=91&mobile=9999999999&template_id=your_template_id&body_variables[0]=John&body_variables[1]=Order #1234&configuration_name=your_payment_config_name&item_name=Premium Subscription&amount=499.00&goods_type=digital-goods&reference_id=ORD-2024-001&quick_pay=1
curl -X POST "' . $externalAPiBaseURL . '/inbox/send-template-message" \
-d "mobile_code=91" \
-d "mobile=9999999999" \
-d "template_id=your_template_id" \
-d "body_variables[0]=John" \
-d "body_variables[1]=Order #1234" \
-d "configuration_name=your_payment_config_name" \
-d "item_name=Premium Subscription" \
-d "amount=499.00" \
-d "goods_type=digital-goods" \
-d "reference_id=ORD-2024-001" \
-d "quick_pay=1" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/send-template-message',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array(
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
'configuration_name' => 'your_payment_config_name',
'item_name' => 'Premium Subscription',
'amount' => '499.00',
'goods_type' => 'digital-goods',
'reference_id' => 'ORD-2024-001',
'quick_pay' => '1',
),
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
'configuration_name' => 'your_payment_config_name',
'item_name' => 'Premium Subscription',
'amount' => '499.00',
'goods_type' => 'digital-goods',
'reference_id' => 'ORD-2024-001',
'quick_pay' => '1',
];
$request->addPostParameter($body);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/send-template-message');
$request->setRequestMethod('POST');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$body = new http\Message\Body;
$body->append(http_build_query([
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
'configuration_name' => 'your_payment_config_name',
'item_name' => 'Premium Subscription',
'amount' => '499.00',
'goods_type' => 'digital-goods',
'reference_id' => 'ORD-2024-001',
'quick_pay' => '1',
]));
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', '' . $externalAPiBaseURL . '/inbox/send-template-message', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
'form_params' => [
'mobile_code' => '91',
'mobile' => '9999999999',
'template_id' => 'your_template_id',
'body_variables[0]' => 'John',
'body_variables[1]' => 'Order #1234',
'configuration_name' => 'your_payment_config_name',
'item_name' => 'Premium Subscription',
'amount' => '499.00',
'goods_type' => 'digital-goods',
'reference_id' => 'ORD-2024-001',
'quick_pay' => '1',
],
]);
echo $response->getBody()->getContents();
import http.client
import urllib.parse
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
"configuration_name": "your_payment_config_name",
"item_name": "Premium Subscription",
"amount": "499.00",
"goods_type": "digital-goods",
"reference_id": "ORD-2024-001",
"quick_pay": "1",
}
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("POST", "/external-api/inbox/send-template-message", body=urllib.parse.urlencode(payload) if locals().get("payload") else None, headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
payload = {
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
"configuration_name": "your_payment_config_name",
"item_name": "Premium Subscription",
"amount": "499.00",
"goods_type": "digital-goods",
"reference_id": "ORD-2024-001",
"quick_pay": "1",
}
url = "' . $externalAPiBaseURL . '/inbox/send-template-message"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.post(url, data=payload, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final payload = {
'mobile_code': '91',
'mobile': '9999999999',
'template_id': 'your_template_id',
'body_variables[0]': 'John',
'body_variables[1]': 'Order #1234',
'configuration_name': 'your_payment_config_name',
'item_name': 'Premium Subscription',
'amount': '499.00',
'goods_type': 'digital-goods',
'reference_id': 'ORD-2024-001',
'quick_pay': '1',
};
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/send-template-message');
final response = await http.post(url,
headers: <?php echo e('client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',); ?>, body: payload,
);
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
)
func main() {
formData := url.Values{
"mobile_code": {"91"},
"mobile": {"9999999999"},
"template_id": {"your_template_id"},
"body_variables[0]": {"John"},
"body_variables[1]": {"Order #1234"},
"configuration_name": {"your_payment_config_name"},
"item_name": {"Premium Subscription"},
"amount": {"499.00"},
"goods_type": {"digital-goods"},
"reference_id": {"ORD-2024-001"},
"quick_pay": {"1"},
}
body := strings.NewReader(formData.Encode())
req, _ := http.NewRequest("POST", "' . $externalAPiBaseURL . '/inbox/send-template-message", body)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}
import java.net.*;
import java.net.http.*;
String body = "mobile_code=91&mobile=9999999999&template_id=your_template_id&body_variables[0]=John&body_variables[1]=Order #1234&configuration_name=your_payment_config_name&item_name=Premium Subscription&amount=499.00&goods_type=digital-goods&reference_id=ORD-2024-001&quick_pay=1";
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/send-template-message"))
.POST(HttpRequest.BodyPublishers.ofString(body))
.header("Content-Type", "application/x-www-form-urlencoded")
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/send-template-message", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
body: new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
"configuration_name": "your_payment_config_name",
"item_name": "Premium Subscription",
"amount": "499.00",
"goods_type": "digital-goods",
"reference_id": "ORD-2024-001",
"quick_pay": "1",
}),
});
const data = await response.json();
console.log(data);
const postData = new URLSearchParams({
"mobile_code": "91",
"mobile": "9999999999",
"template_id": "your_template_id",
"body_variables[0]": "John",
"body_variables[1]": "Order #1234",
"configuration_name": "your_payment_config_name",
"item_name": "Premium Subscription",
"amount": "499.00",
"goods_type": "digital-goods",
"reference_id": "ORD-2024-001",
"quick_pay": "1",
}).toString();
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/send-template-message",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": Buffer.byteLength(postData).toString(),
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Send Template Message (Order Details)
Send an approved WhatsApp template message that includes an ORDER_DETAILS (WhatsApp Pay) button. This allows customers to review item details and complete a UPI payment directly inside WhatsApp. The payment configuration must be set up in your Meta Business Manager and linked to your WhatsApp account.
Base Fields
| Field | Type | Required | Description |
|---|---|---|---|
mobile_code |
string | Yes | Mobile country code without the plus (+) sign (e.g. 91 for India). |
mobile |
string | Yes | Recipient mobile number without country code. Digits only. |
template_id |
string | Yes | Approved WhatsApp template ID that contains an ORDER_DETAILS button. |
from_number |
string | No | WhatsApp Business phone number to send from. Defaults to your primary account if omitted. |
body_variables[] |
array | conditional | Ordered array of values for body placeholder variables. body_variables[0] maps to , body_variables[1] to , etc. |
Order Details — Payment Configuration
All fields below are required when the template contains an ORDER_DETAILS (WhatsApp Pay) button.
| Field | Type | Required | Description |
|---|---|---|---|
configuration_name |
string | Yes | Payment Configuration name as registered in Meta Business Manager for your WhatsApp account (UPI VPA configuration). Must match exactly. |
item_name |
string | Yes | Name of the order item or product (e.g. "Premium Subscription", "Order #1234"). Displayed on the WhatsApp payment screen. |
amount |
numeric | Yes | Order amount in INR (Indian Rupee). Must be a positive number. Example: 499.00 for ₹499. |
goods_type |
string | No | Type of goods being sold. Accepted values: digital-goods (default), physical-goods. |
reference_id |
string | No | Your internal order or invoice reference ID (e.g. "ORD-2024-001"). Used for payment reconciliation on your end. |
quick_pay |
boolean | No | Set to 1 (true) to enable Quick Pay mode — the customer can complete payment without reviewing the order details screen. Default: false (0). |
Notes
WhatsApp Pay / ORDER_DETAILS is currently supported only for Indian businesses using UPI VPA payment configurations.
The payment configuration must be active and linked to your WhatsApp Business account in Meta Business Manager.
The amount currency is always INR (₹). Ensure the value passed matches the actual charge.
The configuration_name value is case-insensitive but must match the name registered in Meta Business Manager.
Blocked contacts cannot receive template messages.
Only approved WhatsApp templates with an ORDER_DETAILS button will trigger the payment flow.
GET /external-api/inbox/template-list HTTP/1.1
Host: ' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '
client-id: YOUR-CLIENT-ID
client-secret: YOUR-CLIENT-SECRET
curl -X GET "' . $externalAPiBaseURL . '/inbox/template-list" \
-H "client-id: YOUR-CLIENT-ID" \
-H "client-secret: YOUR-CLIENT-SECRET"
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '' . $externalAPiBaseURL . '/inbox/template-list',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'client-id: YOUR-CLIENT-ID',
'client-secret: YOUR-CLIENT-SECRET',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('' . $externalAPiBaseURL . '/inbox/template-list');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setHeader([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$response = $request->send();
echo $response->getBody();
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('' . $externalAPiBaseURL . '/inbox/template-list');
$request->setRequestMethod('GET');
$request->setHeaders([
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', '' . $externalAPiBaseURL . '/inbox/template-list', [
'headers' => [
'client-id' => 'YOUR-CLIENT-ID',
'client-secret' => 'YOUR-CLIENT-SECRET',
],
]);
echo $response->getBody()->getContents();
import http.client
conn = http.client.HTTPSConnection("' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '")
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
conn.request("GET", "/external-api/inbox/template-list", headers=headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
import requests
url = "' . $externalAPiBaseURL . '/inbox/template-list"
headers = {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
}
resp = requests.get(url, headers=headers)
print(resp.text)
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('' . $externalAPiBaseURL . '/inbox/template-list');
final response = await http.get(url, headers: {
'client-id': 'YOUR-CLIENT-ID',
'client-secret': 'YOUR-CLIENT-SECRET',
});
print(response.body);
}
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "' . $externalAPiBaseURL . '/inbox/template-list", nil)
req.Header.Set("client-id", "YOUR-CLIENT-ID")
req.Header.Set("client-secret", "YOUR-CLIENT-SECRET")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
import java.net.*;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("' . $externalAPiBaseURL . '/inbox/template-list"))
.GET()
.header("client-id", "YOUR-CLIENT-ID")
.header("client-secret", "YOUR-CLIENT-SECRET")
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
const response = await fetch("' . $externalAPiBaseURL . '/inbox/template-list", {
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
});
const data = await response.json();
console.log(data);
const https = require("https");
const options = {
hostname: "' . parse_url($externalAPiBaseURL, PHP_URL_HOST) . '",
path: "/external-api/inbox/template-list",
method: "GET",
headers: {
"client-id": "YOUR-CLIENT-ID",
"client-secret": "YOUR-CLIENT-SECRET",
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => (data += chunk));
res.on("end", () => console.log(data));
});
req.end();
Get Template List
This endpoint allows you to fetch all WhatsApp templates associated with your account.