Dxing Logo

WhatsApp API Documentation

Empowering businesses of all types with seamless communication solutions.

Available WooCommerce plugin Start Free Trial View Documentation

Why Choose Dx WhatsApp API?

DxAPI is a simple yet powerful API gateway for sending WhatsApp messages. It provides complete control over your virtual WhatsApp application, enabling seamless integration through easy-to-use REST API requests.

Fast & Reliable

Send messages instantly with our high-performance API infrastructure

Secure Communication

Ensure end-to-end encrypted communication for OTPs and messages.

Easy Integration

Integrate quickly with simple API endpoints and clear documentation.

How it works?

Fixed price, no hidden fees, unlimited messages, no cost per message.
Quick Onboarding in less than 5 minutes.

Create Account

Sign up at Dxing Dashboard and create an account to get your API secret ID.

Scan QR

Scan QR to authenticate your account to send messages via your WhatsApp number.

Start Sending Messages

Start sending messages via API with your favorite programming languages.

WhatsApp API Documentation

This documentation provides details on the APIs available for sending and verifying OTP messages and sending single chat messages via WhatsApp. To use the WhatsApp API, you need to create an account at app.dxing.in. Ensure you have the required API permissions and valid API keys for seamless integration.

WhatsApp - Send Single Message

Send a single chat message. Requires wa_send API permission when creating API secret keys.

API Endpoint

POST: https://app.dxing.in/api/send/whatsapp

Parameters

Parameter Type Description Required
secret string Your API secret key. You can obtain it from your API keys page . Yes
account string Your WhatsApp account unique ID. You can obtain it from your WhatsApp hosts page . Yes
recipient string Recipient's mobile number in E.164 or local format, or Group Address. Yes
type string Type of message. Allowed values: text, media, document. Yes
message string Message or caption to send. Yes
media_file string This is for "media" type messages. Supported formats: jpg, png, gif, mp4, mp3, ogg. No
media_url string This is for "media" type messages. Use a direct link to the media file. No
media_type string This is for "media" type messages. Use this parameter if you are using "media_url" instead of "media_file".
Allowed values: "image", "audio", "video".
No
document_file file This is for "document" type messages. Attach a file (pdf, xls, xlsx, doc, docx). No
document_url string This is for "document" type messages. Use a direct link to the document file (pdf, xls, xlsx, doc, docx). No
document_name string This is for "document" type messages with "document_url". Include the file name with extension (e.g., document.pdf). No
document_type string This is for "document" type messages. Use this parameter if you are using "document_url" instead of "document_file".
Allowed values: "pdf", "xls", "xlsx", "doc", "docx".
No
shortener number Link Shortener ID. For unlimited use, choose DxLink: 1, 2, or 3. No
priority number Set to 1 for high priority, 2 for normal priority. Default: 2. No

WhatsApp API Code Examples

fetch("https://app.dxing.in/api/send/whatsapp", {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify({
        secret: "your_api_secret",
        account: "your_account_id",
        recipient: "919895123456",
        type: "text",
        message: "Hello! This is a test message."
    })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
import requests
import json

url = "https://app.dxing.in/api/send/whatsapp"
headers = {"Content-Type": "application/json"}
data = {
    "secret": "your_api_secret",
    "account": "your_account_id",
    "recipient": "919895123456",
    "type": "text",
    "message": "Hello! This is a test message."
}

response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
$url = "https://app.dxing.in/api/send/whatsapp";
$data = json_encode([
    "secret" => "your_api_secret",
    "account" => "your_account_id",
    "recipient" => "919895123456",
    "type" => "text",
    "message" => "Hello! This is a test message."
]);

$options = [
    "http" => [
        "header" => "Content-Type: application/json", 
        "method" => "POST", 
        "content" => $data
    ]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
curl -X POST "https://app.dxing.in/api/send/whatsapp" \
    -H "Content-Type: application/json" \
    -d '{
        "secret": "your_api_secret",
        "account": "your_account_id",
        "recipient": "919895123456",
        "type": "text",
        "message": "Hello! This is a test message."
    }'

Sample Request

POST https://app.dxing.in/api/send/whatsapp.bulk
{
    "secret": "1324335a4h455465769712",
    "account": "172970977************a6f75849b671946d3b7e64",
    "recipient": "919895123456, 91813123456, 91721123456",
    "type": "text",
    "message": "Hello! This is Bulk message from Dxing WhatsApp API",
}

Success Response


{
    "status": 200,
    "message": "X chats has been queued for sending!",
    "data": {
        "campaignId":"2104","messageIds":["1541239345","1541242220]"
    }
}

Error Response


{
    "status": 400,
    "message": "Invalid Parameters!",
    "data": false
}

Sample Request

POST https://app.dxing.in/api/send/whatsapp
{
    "secret": "1324335a4h455465769712",
    "account": "172970977************a6f75849b671946d3b7e64",
    "recipient": "919895123456",
    "type": "text",
    "message": "Hello! This is a test message from Dxing WhatsApp API",
    "priority": 1
}

Success Response


{
    "status": 200,
    "message": "Your message was successfully delivered",
    "data": {
        "messageId": "DXWA_544614"
    }
}

Error Response


{
    "status": 400,
    "message": "Invalid Parameters!",
    "data": false
}

WhatsApp - Send Bulk Message

Send Bulk chat message. Requires wa_send_bulk API permission when creating API secret keys.

API Endpoint

POST: https://app.dxing.in/api/send/whatsapp.bulk

Parameters

Parameter Type Description Required
secret string Your API secret key. You can obtain it from your API keys page . Yes
account string Your WhatsApp account unique ID. You can obtain it from your WhatsApp hosts page . Yes
campaign string Campaign Name Yes
recipients string List of phone numbers or group addresses separated by commas Yes
type string Type of message. Allowed values: text, media, document. Yes
message string Message or caption to send. Yes
media_file string This is for "media" type messages. Supported formats: jpg, png, gif, mp4, mp3, ogg. No
media_url string This is for "media" type messages. Use a direct link to the media file. No
media_type string This is for "media" type messages. Use this parameter if you are using "media_url" instead of "media_file".
Allowed values: "image", "audio", "video".
No
document_file file This is for "document" type messages. Attach a file (pdf, xls, xlsx, doc, docx). No
document_url string This is for "document" type messages. Use a direct link to the document file (pdf, xls, xlsx, doc, docx). No
document_name string This is for "document" type messages with "document_url". Include the file name with extension (e.g., document.pdf). No
document_type string This is for "document" type messages. Use this parameter if you are using "document_url" instead of "document_file".
Allowed values: "pdf", "xls", "xlsx", "doc", "docx".
No
shortener number Link Shortener ID. For unlimited use, choose DxLink: 1, 2, or 3. No

Send OTP

This API allows you to send and verify OTP messages via WhatsApp. Ensure that you have the otp API permission enabled when creating your API secret keys.

API Endpoints

POST: https://app.dxing.in/api/send/otp

GET: https://app.dxing.in/api/get/otp

Send OTP

Use this endpoint to send an OTP message via WhatsApp.

POST https://app.dxing.in/api/send/otp
{
    "secret": "b7d99f833a23b968b04366wuhdjkdkds",
    "type": "whatsapp",
    "message": "Your OTP is {{otp}}. It will expire in 5 minutes.",
    "phone": "919895123456",
    "account": "1730460254c4ca4238a0bsgdj637389",
    "priority": 1
}

Parameters

Parameter Type Description Required
secret string Your API secret key. Yes
type string Message type. Use whatsapp. Yes
message string OTP template with placeholder {{otp}}. Yes
phone string Recipient's phone number with country code. Yes
account string Associated account ID. Yes
priority integer Message priority (default: 1). No

Response Examples

Success Response


{
    "status": 200,
    "message": "OTP has been sent!",
    "data": {
        "phone": "+919895123456",
        "message": "Your OTP is 737543",
        "messageId": "544507",
        "otp": 737543
    }
}

Error Response

{
    "status": "error",
    "message": "Invalid API secret or missing parameters."
}

Verify OTP

Use this endpoint to verify an OTP.

GET https://app.dxing.in/api/get/otp?secret=b7d99f833a23b968b040aafysysu7883&otp=308160

Query Parameters

Parameter Type Description Required
secret string Your API secret key. Yes
otp string OTP to verify. Yes

Success Response


{
    "status": 200,
    "message": "OTP has been verified!",
    "data": false
}

Error Response


{
    "status": 403,
    "message": "OTP is invalid or expired!",
    "data": false
}

Webhook

Webhooks are one of the most useful features of our platform. It allows developers and site owners to listen for events from the devices or WhatsApp server, which is useful for creating automated tasks.

Payload Structure

{
    "type": "whatsapp",
    "data": {
        "id": 2,
        "wid": "+639760713666",
        "phone": "+639760666713",
        "message": "Hello World!",
        "attachment": "http://imageurl.com/image.jpg",
        "timestamp": 1645684231
    }
}

Notes

  • Ensure you have the correct API secret key.
  • Replace {{otp}} in the message template with the actual OTP.
  • Phone numbers must include the country code.