Introduction
Complete documentation for integrating with our WhatsApp messaging platform
WhatsApp Business API
This documentation provides everything you need to integrate with our WhatsApp messaging platform.
Key Features
Send text messages
Authenticating requests
This API is not authenticated.
WhatsApp API
Ping the server
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/ping';
$response = $client->get(
$url,
[
'headers' => [
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/ping"
);
const headers = {
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "https://chat.digiworld-dev.com/api/whatsapp/architecto/ping" \
--header "Accept: application/json"
Example response (200):
Server is running
Example response (401):
Invalid or expired token
Example response (429):
Too many requests
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get session status
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/status';
$response = $client->get(
$url,
[
'headers' => [
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/status"
);
const headers = {
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "https://chat.digiworld-dev.com/api/whatsapp/architecto/status" \
--header "Accept: application/json"
Example response (200):
{
"success": true,
"state": "CONNECTED",
"message": "session_connected"
}
Example response (401):
Invalid or expired token
Example response (429):
Too many requests
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Terminate session
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/terminate';
$response = $client->get(
$url,
[
'headers' => [
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/terminate"
);
const headers = {
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "https://chat.digiworld-dev.com/api/whatsapp/architecto/terminate" \
--header "Accept: application/json"
Example response (200):
{
"success": true,
"message": "Logged out successfully"
}
Example response (401):
Invalid or expired token
Example response (429):
Too many requests
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get QR code
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/qr';
$response = $client->get(
$url,
[
'headers' => [
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/qr"
);
const headers = {
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "https://chat.digiworld-dev.com/api/whatsapp/architecto/qr" \
--header "Accept: application/json"
Example response (200):
QR code data
Example response (401):
Invalid or expired token
Example response (429):
Too many requests
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get QR code image
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/qr/image';
$response = $client->get(
$url,
[
'headers' => [
'Content-Type' => 'image/png',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/qr/image"
);
const headers = {
"Content-Type": "image/png",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "https://chat.digiworld-dev.com/api/whatsapp/architecto/qr/image" \
--header "Content-Type: image/png" \
--header "Accept: application/json"
Example response (200):
image/png
Example response (401):
Invalid or expired token
Example response (429):
Too many requests
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Send message
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://chat.digiworld-dev.com/api/whatsapp/architecto/sendMessage';
$response = $client->post(
$url,
[
'headers' => [
'X-API-Timestamp' => 'integer required Unix timestamp in milliseconds. Should match the client time when the request is made.',
'X-API-Signature' => 'string required HMAC-SHA256 signature of (timestamp + token + request body) using your API secret.',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'phone' => '"963912345678"',
'message' => '"Hello from our API!"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://chat.digiworld-dev.com/api/whatsapp/architecto/sendMessage"
);
const headers = {
"X-API-Timestamp": "integer required Unix timestamp in milliseconds. Should match the client time when the request is made.",
"X-API-Signature": "string required HMAC-SHA256 signature of (timestamp + token + request body) using your API secret.",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"phone": "\"963912345678\"",
"message": "\"Hello from our API!\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"https://chat.digiworld-dev.com/api/whatsapp/architecto/sendMessage" \
--header "X-API-Timestamp: integer required Unix timestamp in milliseconds. Should match the client time when the request is made." \
--header "X-API-Signature: string required HMAC-SHA256 signature of (timestamp + token + request body) using your API secret." \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"phone\": \"\\\"963912345678\\\"\",
\"message\": \"\\\"Hello from our API!\\\"\"
}"
Example response (200):
{
"success": true,
"message_id": "ABC123456",
"message": "Message sent successfully"
}
Example response (400):
{
"success": false,
"message": "Invalid request data"
}
Example response (401):
{
"success": false,
"message": "Invalid or expired token"
}
Example response (429):
{
"success": false,
"message": "Too many requests"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.