curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp",
"urlOptions": {
"shortenUrl": true,
"trackClicks": true,
"trackingUrl": "https://example.com/click-report",
"removeProtocol": true
}
}
'import requests
url = "https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request"
payload = {
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp",
"urlOptions": {
"shortenUrl": True,
"trackClicks": True,
"trackingUrl": "https://example.com/click-report",
"removeProtocol": True
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"from\": \"353861234583\",\n \"to\": \"353861234584\",\n \"messageId\": \"a28dd97c-1ffb-4fcf-99f1-0b557ed381da\",\n \"callbackData\": \"Callback data\",\n \"notifyUrl\": \"https://www.example.com/whatsapp\",\n \"urlOptions\": {\n \"shortenUrl\": true,\n \"trackClicks\": true,\n \"trackingUrl\": \"https://example.com/click-report\",\n \"removeProtocol\": true\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"353861234583\",\n \"to\": \"353861234584\",\n \"messageId\": \"a28dd97c-1ffb-4fcf-99f1-0b557ed381da\",\n \"callbackData\": \"Callback data\",\n \"notifyUrl\": \"https://www.example.com/whatsapp\",\n \"urlOptions\": {\n \"shortenUrl\": true,\n \"trackClicks\": true,\n \"trackingUrl\": \"https://example.com/click-report\",\n \"removeProtocol\": true\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request",
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([
'from' => '353861234583',
'to' => '353861234584',
'messageId' => 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da',
'callbackData' => 'Callback data',
'notifyUrl' => 'https://www.example.com/whatsapp',
'urlOptions' => [
'shortenUrl' => true,
'trackClicks' => true,
'trackingUrl' => 'https://example.com/click-report',
'removeProtocol' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '353861234583',
to: '353861234584',
messageId: 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da',
callbackData: 'Callback data',
notifyUrl: 'https://www.example.com/whatsapp',
urlOptions: {
shortenUrl: true,
trackClicks: true,
trackingUrl: 'https://example.com/click-report',
removeProtocol: true
}
})
};
fetch('https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"to": "353861234584",
"messageCount": 1,
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
}
}{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "UNAUTHORIZED",
"text": "Unauthorized"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "FORBIDDEN",
"text": "Forbidden"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "TOO_MANY_REQUESTS",
"text": "Too many requests"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "GENERAL_ERROR",
"text": "Something went wrong. Please contact support."
}
}
}Send WhatsApp interactive in-thread authentication request message
Send an interactive in-thread authentication request message to a single recipient. Interactive in-thread authentication request messages can only be successfully delivered if the recipient has contacted the business within the last 24 hours, otherwise template message should be used.
The API response will not contain the final delivery status, use Delivery Reports instead.
Required scope: Enable one of: message:send, whatsapp:message:send, whatsapp:manage.
curl --request POST \
--url https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp",
"urlOptions": {
"shortenUrl": true,
"trackClicks": true,
"trackingUrl": "https://example.com/click-report",
"removeProtocol": true
}
}
'import requests
url = "https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request"
payload = {
"from": "353861234583",
"to": "353861234584",
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"callbackData": "Callback data",
"notifyUrl": "https://www.example.com/whatsapp",
"urlOptions": {
"shortenUrl": True,
"trackClicks": True,
"trackingUrl": "https://example.com/click-report",
"removeProtocol": True
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"from\": \"353861234583\",\n \"to\": \"353861234584\",\n \"messageId\": \"a28dd97c-1ffb-4fcf-99f1-0b557ed381da\",\n \"callbackData\": \"Callback data\",\n \"notifyUrl\": \"https://www.example.com/whatsapp\",\n \"urlOptions\": {\n \"shortenUrl\": true,\n \"trackClicks\": true,\n \"trackingUrl\": \"https://example.com/click-report\",\n \"removeProtocol\": true\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"353861234583\",\n \"to\": \"353861234584\",\n \"messageId\": \"a28dd97c-1ffb-4fcf-99f1-0b557ed381da\",\n \"callbackData\": \"Callback data\",\n \"notifyUrl\": \"https://www.example.com/whatsapp\",\n \"urlOptions\": {\n \"shortenUrl\": true,\n \"trackClicks\": true,\n \"trackingUrl\": \"https://example.com/click-report\",\n \"removeProtocol\": true\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request",
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([
'from' => '353861234583',
'to' => '353861234584',
'messageId' => 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da',
'callbackData' => 'Callback data',
'notifyUrl' => 'https://www.example.com/whatsapp',
'urlOptions' => [
'shortenUrl' => true,
'trackClicks' => true,
'trackingUrl' => 'https://example.com/click-report',
'removeProtocol' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '353861234583',
to: '353861234584',
messageId: 'a28dd97c-1ffb-4fcf-99f1-0b557ed381da',
callbackData: 'Callback data',
notifyUrl: 'https://www.example.com/whatsapp',
urlOptions: {
shortenUrl: true,
trackClicks: true,
trackingUrl: 'https://example.com/click-report',
removeProtocol: true
}
})
};
fetch('https://api.messaging.phonovation.com/whatsapp/1/message/interactive/in-thread-authentication-request', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"to": "353861234584",
"messageCount": 1,
"messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
}
}{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "UNAUTHORIZED",
"text": "Unauthorized"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "FORBIDDEN",
"text": "Forbidden"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "TOO_MANY_REQUESTS",
"text": "Too many requests"
}
}
}{
"requestError": {
"serviceException": {
"messageId": "GENERAL_ERROR",
"text": "Something went wrong. Please contact support."
}
}
}Authorizations
This is the most secure authorization type and the one with the most flexibility.
API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.
You can manage your API keys from GUI, or programmatically with dedicated API.
API key Authorization header example:
Authorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9
Body
Registered WhatsApp sender number. Must be in international format and comply with WhatsApp's requirements.
1 - 24Message recipient number in international format or WhatsApp business-scoped user ID.
1 - 150The ID that uniquely identifies the message sent.
200Custom client data that will be included in a Delivery Report.
4000The URL on your callback server to which delivery and seen reports will be sent. Delivery report format, Seen report format.
2048Sets up URL shortening and tracking feature.
Show child attributes
Show child attributes
Required for entity use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.
255Required for application use in a send request for outbound traffic. Returned in notification events. For more details, see our documentation.
255Context object to define WhatsApp-specific metadata about a message.
Show child attributes
Show child attributes
Response
Message accepted for delivery
The destination address of the message.
"353861234572"
Number of messages required to deliver.
1
The ID that uniquely identifies the message sent. If not passed, it will be automatically generated and returned in a response.
"06df139a-7eb5-4a6e-902e-40e892210455"