Receive template delivery report
curl --request POST \
--url https://example.com/template-dlr \
--header 'Content-Type: application/json' \
--data '
{
"broadcast_id": "broadcastid_123123",
"message_id": "msgid_123123",
"status": "read",
"destination": "255******581",
"message": "Your order has shipped",
"timestamp": "2023-06-26 02:31:29"
}
'import requests
url = "https://example.com/template-dlr"
payload = {
"broadcast_id": "broadcastid_123123",
"message_id": "msgid_123123",
"status": "read",
"destination": "255******581",
"message": "Your order has shipped",
"timestamp": "2023-06-26 02:31:29"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
broadcast_id: 'broadcastid_123123',
message_id: 'msgid_123123',
status: 'read',
destination: '255******581',
message: 'Your order has shipped',
timestamp: '2023-06-26 02:31:29'
})
};
fetch('https://example.com/template-dlr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/template-dlr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'broadcast_id' => 'broadcastid_123123',
'message_id' => 'msgid_123123',
'status' => 'read',
'destination' => '255******581',
'message' => 'Your order has shipped',
'timestamp' => '2023-06-26 02:31:29'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/template-dlr"
payload := strings.NewReader("{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://example.com/template-dlr")
.header("Content-Type", "application/json")
.body("{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://example.com/template-dlr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}"
response = http.request(request)
puts response.read_bodyMOJA Broadcast API
Receive template delivery report
Webhook your application must implement. Beem POSTs WhatsApp template delivery status updates (accepted, delivered, read, failed) to the callback URL configured in the Engage portal under API Setup. Replace the server URL with your own HTTPS endpoint.
POST
/
template-dlr
Receive template delivery report
curl --request POST \
--url https://example.com/template-dlr \
--header 'Content-Type: application/json' \
--data '
{
"broadcast_id": "broadcastid_123123",
"message_id": "msgid_123123",
"status": "read",
"destination": "255******581",
"message": "Your order has shipped",
"timestamp": "2023-06-26 02:31:29"
}
'import requests
url = "https://example.com/template-dlr"
payload = {
"broadcast_id": "broadcastid_123123",
"message_id": "msgid_123123",
"status": "read",
"destination": "255******581",
"message": "Your order has shipped",
"timestamp": "2023-06-26 02:31:29"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
broadcast_id: 'broadcastid_123123',
message_id: 'msgid_123123',
status: 'read',
destination: '255******581',
message: 'Your order has shipped',
timestamp: '2023-06-26 02:31:29'
})
};
fetch('https://example.com/template-dlr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/template-dlr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'broadcast_id' => 'broadcastid_123123',
'message_id' => 'msgid_123123',
'status' => 'read',
'destination' => '255******581',
'message' => 'Your order has shipped',
'timestamp' => '2023-06-26 02:31:29'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/template-dlr"
payload := strings.NewReader("{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://example.com/template-dlr")
.header("Content-Type", "application/json")
.body("{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://example.com/template-dlr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"broadcast_id\": \"broadcastid_123123\",\n \"message_id\": \"msgid_123123\",\n \"status\": \"read\",\n \"destination\": \"255******581\",\n \"message\": \"Your order has shipped\",\n \"timestamp\": \"2023-06-26 02:31:29\"\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Broadcast job ID from the template send request.
Unique message ID for this delivery report.
Delivery status of the template message.
Available options:
accepted, delivered, read, failed Recipient phone number.
Message content or status detail.
When the status update occurred.
Response
200
Acknowledge receipt of the delivery report
⌘I
