MENU navbar-image

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
 

Request      

GET api/whatsapp/{token}/ping

Headers

Accept      

Example: application/json

URL Parameters

token   string   

Your API access token Example: architecto

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
 

Request      

GET api/whatsapp/{token}/status

Headers

Accept      

Example: application/json

URL Parameters

token   string   

Your API access token Example: architecto

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
 

Request      

GET api/whatsapp/{token}/terminate

Headers

Accept      

Example: application/json

URL Parameters

token   string   

Your API access token Example: architecto

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
 

Request      

GET api/whatsapp/{token}/qr

Headers

Accept      

Example: application/json

URL Parameters

token   string   

Your API access token Example: architecto

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
 

Request      

GET api/whatsapp/{token}/qr/image

Headers

Content-Type      

Example: image/png

Accept      

Example: application/json

URL Parameters

token   string   

Your API access token Example: architecto

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"
}
 

Request      

POST api/whatsapp/{token}/sendMessage

Headers

X-API-Timestamp      

Example: integer required Unix timestamp in milliseconds. Should match the client time when the request is made.

X-API-Signature      

Example: string required HMAC-SHA256 signature of (timestamp + token + request body) using your API secret.

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

token   string   

Your API access token (included in URL). Example: architecto

Body Parameters

phone   string   

Recipient phone number in format 9639xxxxxxxx. Example: "963912345678"

message   string   

Text message content to send. Example: "Hello from our API!"