List WhatsApp templates
Returns the WhatsApp templates you can send right now — approved ones only — together with the number of values and what else each template needs. Templates are created in your cabinet and approved by Meta.
URI: https://blackbox.business/api/json.php
All requests to API are sent in JSON format using the POST method.
Header parameters
Requests must contain header Content-Type: application/json, otherwise, the request will be considered invalid even if it has valid JSON.
Request parameters
Request example
- JSON
- cURL
- PHP
- Python
- Node.js
{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "template/whatsapp/list",
"signature": "WhatsAppTest"
}
]
}
curl -X POST 'https://blackbox.business/api/json.php' \
-H 'Content-Type: application/json' \
--data-raw '{
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "template/whatsapp/list",
"signature": "WhatsAppTest"
}
]
}'
<?php
$payload = json_encode([
'auth' => 'bb56a4369eb19***cfec6d1776bd25',
'data' => [
[
'type' => 'template/whatsapp/list',
'signature' => 'WhatsAppTest',
],
],
], JSON_UNESCAPED_UNICODE);
$ch = curl_init('https://blackbox.business/api/json.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "template/whatsapp/list",
"signature": "WhatsAppTest",
},
],
}
response = requests.post(
"https://blackbox.business/api/json.php",
json=payload,
timeout=30,
)
print(response.json())
const payload = {
"auth": "bb56a4369eb19***cfec6d1776bd25",
"data": [
{
"type": "template/whatsapp/list",
"signature": "WhatsAppTest"
}
]
};
const response = await fetch("https://blackbox.business/api/json.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
console.log(await response.json());
Response parameters
| successboolean Result of request execution | |||||||||||||||
| errorstring Error text, returned if success=false | |||||||||||||||
| datalist[object] List of objects with the results of request execution
|
Response examples
- Successful
- Access denied
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": true,
"data": [
{
"success": true,
"data": [
{
"id": 17,
"name": "order_ready",
"language": "en",
"category": "utility",
"template": "Hello {{1}}, your order {{2}} is ready for pickup.",
"params": 2,
"shape": {
"header": "image",
"header_var": false,
"url_button": false,
"copy_code": false,
"authentication": false
},
"status": "approved"
},
{
"id": 18,
"name": "login_code",
"language": "en",
"category": "authentication",
"template": "*{{1}}* is your verification code.",
"params": 1,
"shape": {
"header": null,
"header_var": false,
"url_button": true,
"copy_code": false,
"authentication": true
},
"status": "approved"
}
]
}
]
}
HTTP Status Code: 200
Content Type: JSON application/json
{
"success": false,
"error": "Access denied"
}