Overview and parameters

This Documentation provide WhatsApp API Guidence

📌 Parameters Detail
Parameter Value (Sample) Required Description
apikey 54XXXXXXXXXXXXX Mandatory Assigned API key of user
waba-number 9198xxxxxxxx Mandatory Default WABA number will be used if not provided
mobiles 9199xxxxxxxx Mandatory Recipient mobile numbers
template template_name Mandatory Template name registered in system
header {{1}} Optional Header variables
body {{1}} {{2}} Optional Body variables
button {{1}} {{2}} Optional Button variables
client-message-id xxxxx Optional Unique reference ID from client
⚠️ Error Codes
Code Status Description
-101 Unknown Unexpected system error
000 Success Request processed successfully
001 Required Missing mandatory parameter
002 Invalid Invalid parameter value
003 Failed Processing failed
004 Duplicate Duplicate request detected

Request reference

Request

POST https://{Domain}/client/api/whatsapp

Code examples

Code example
curl --location --request POST 'https://{Domain}/client/api/whatsapp' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "apikey": "545xyzxyzxyz5069",
    "message": {
        "data": [
            {
                "key": "waba-number",
                "value": "9198xxxxxxxx",
                "type": "text"
            },
            {
                "key": "mobiles",
                "value": "9199xxxxxxxx",
                "type": "text"
            },
            {
                "key": "template",
                "value": "templatename",
                "type": "text"
            },
            {
                "key": "header",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Alex"
                    }
                ]
            },
            {
                "key": "body",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "1234"
                    },
                    {
                        "type": "text",
                        "text": "60"
                    }
                ]
            },
            {
                "key": "button",
                "parameters": [
                    {
                        "type": "text",
                        "text": "xxx",
                        "index": "0"
                    },
                    {
                        "type": "text",
                        "text": "yyy",
                        "index": "1"
                    }
                ]
            },
            {
                "key": "client-message-id",
                "value": "xxxxx",
                "type": "text"
            },
            {
                "type": "text",
                "value": "template",
                "key": "template-type"
            }
        ]
    }
}'
const url = "https://{Domain}/client/api/whatsapp";
const options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "apikey": "545xyzxyzxyz5069",
    "message": {
        "data": [
            {
                "key": "waba-number",
                "value": "9198xxxxxxxx",
                "type": "text"
            },
            {
                "key": "mobiles",
                "value": "9199xxxxxxxx",
                "type": "text"
            },
            {
                "key": "template",
                "value": "templatename",
                "type": "text"
            },
            {
                "key": "header",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Alex"
                    }
                ]
            },
            {
                "key": "body",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "1234"
                    },
                    {
                        "type": "text",
                        "text": "60"
                    }
                ]
            },
            {
                "key": "button",
                "parameters": [
                    {
                        "type": "text",
                        "text": "xxx",
                        "index": "0"
                    },
                    {
                        "type": "text",
                        "text": "yyy",
                        "index": "1"
                    }
                ]
            },
            {
                "key": "client-message-id",
                "value": "xxxxx",
                "type": "text"
            },
            {
                "type": "text",
                "value": "template",
                "key": "template-type"
            }
        ]
    }
})
};

const response = await fetch(url, options);
const data = await response.json();
console.log(data);
import requests

url = "https://{Domain}/client/api/whatsapp"
headers = {
    "Content-Type": "application/json"
}
payload = '''{
    "apikey": "545xyzxyzxyz5069",
    "message": {
        "data": [
            {
                "key": "waba-number",
                "value": "9198xxxxxxxx",
                "type": "text"
            },
            {
                "key": "mobiles",
                "value": "9199xxxxxxxx",
                "type": "text"
            },
            {
                "key": "template",
                "value": "templatename",
                "type": "text"
            },
            {
                "key": "header",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Alex"
                    }
                ]
            },
            {
                "key": "body",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "1234"
                    },
                    {
                        "type": "text",
                        "text": "60"
                    }
                ]
            },
            {
                "key": "button",
                "parameters": [
                    {
                        "type": "text",
                        "text": "xxx",
                        "index": "0"
                    },
                    {
                        "type": "text",
                        "text": "yyy",
                        "index": "1"
                    }
                ]
            },
            {
                "key": "client-message-id",
                "value": "xxxxx",
                "type": "text"
            },
            {
                "type": "text",
                "value": "template",
                "key": "template-type"
            }
        ]
    }
}'''

response = requests.request(
    "POST",
    url,
    headers=headers,
    data=payload
)
print(response.json())
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://{Domain}/client/api/whatsapp",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => <<<'JSON'
{
    "apikey": "545xyzxyzxyz5069",
    "message": {
        "data": [
            {
                "key": "waba-number",
                "value": "9198xxxxxxxx",
                "type": "text"
            },
            {
                "key": "mobiles",
                "value": "9199xxxxxxxx",
                "type": "text"
            },
            {
                "key": "template",
                "value": "templatename",
                "type": "text"
            },
            {
                "key": "header",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Alex"
                    }
                ]
            },
            {
                "key": "body",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "1234"
                    },
                    {
                        "type": "text",
                        "text": "60"
                    }
                ]
            },
            {
                "key": "button",
                "parameters": [
                    {
                        "type": "text",
                        "text": "xxx",
                        "index": "0"
                    },
                    {
                        "type": "text",
                        "text": "yyy",
                        "index": "1"
                    }
                ]
            },
            {
                "key": "client-message-id",
                "value": "xxxxx",
                "type": "text"
            },
            {
                "type": "text",
                "value": "template",
                "key": "template-type"
            }
        ]
    }
}
JSON,
    CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
    ]
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;

Request body

JSON body
{
    "apikey": "545xyzxyzxyz5069",
    "message": {
        "data": [
            {
                "key": "waba-number",
                "value": "9198xxxxxxxx",
                "type": "text"
            },
            {
                "key": "mobiles",
                "value": "9199xxxxxxxx",
                "type": "text"
            },
            {
                "key": "template",
                "value": "templatename",
                "type": "text"
            },
            {
                "key": "header",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "Alex"
                    }
                ]
            },
            {
                "key": "body",
                "value": "",
                "type": "text",
                "parameters": [
                    {
                        "type": "text",
                        "text": "1234"
                    },
                    {
                        "type": "text",
                        "text": "60"
                    }
                ]
            },
            {
                "key": "button",
                "parameters": [
                    {
                        "type": "text",
                        "text": "xxx",
                        "index": "0"
                    },
                    {
                        "type": "text",
                        "text": "yyy",
                        "index": "1"
                    }
                ]
            },
            {
                "key": "client-message-id",
                "value": "xxxxx",
                "type": "text"
            },
            {
                "type": "text",
                "value": "template",
                "key": "template-type"
            }
        ]
    }
}

Response example

JSON response
{
"status": {
"error-code": "",
"error-status": "",
"error-description": ""
},
"response-details": [
{
"success-count": "",
"sent-details": [
{
"client-id": "",
"message-id": "",
"mobile-no": ""
}
],
"failed-details": [{
"count": "",
"reasons": [
{
"client-id": "",
"mobile-no": "","failed-reason": "",
"message-content": ""
}
]
}
]
}
]
}