Build Powerful Messaging Applications
A single REST endpoint for sending WhatsApp messages, media, documents, scheduled and bulk/personalized campaigns — fast, reliable and secure, in whichever language your stack already uses.
https://wahgreat.com/api/
Introduction
This documentation explains how to integrate wahgreat.com messaging services into your application over a simple HTTP API. The API is based on REST standards, so any HTTP client in any programming language can call it — PHP, JavaScript, Python, C#, VB.NET, Java, Node.js and more.
A single endpoint handles text, image and document messages, and supports single requests, personalized bulk requests, and scheduled delivery.
Authentication
Every request must include your api_key as a GET or POST parameter — there is no separate Authorization header. Get your credentials in three steps:
api_key from the dashboard.api_key secret — anyone with it can send messages from your connected WhatsApp number.Base URL
This platform is multi-tenant: your Base URL is always your own account domain, shown below. Every example on this page uses it automatically.
https://wahgreat.com/api/
/api/send.php
Send a plain text WhatsApp message. This is the default message type (type=0).
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your API key |
| mobile | string | Yes | Recipient in international format, e.g. 923001234567 |
| message | string | Yes | The text message body |
Example Request
curl --location --request POST 'https://wahgreat.com/api/send.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=YOUR-SECRET-API-KEY' \
--data-urlencode 'mobile=923XXXX' \
--data-urlencode 'message=HelloWorld'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://wahgreat.com/api/send.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'api_key=YOUR-SECRET-API-KEY&mobile=923XXX&message=HelloWorld',
CURLOPT_HTTPHEADER => array('Content-Type: application/x-www-form-urlencoded'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'api_key': 'YOUR-SECRET-API-KEY',
'mobile': '923XXXX',
'message': 'HelloWorld'
});
axios({
method: 'post',
url: 'https://wahgreat.com/api/send.php',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: data
}).then(function (response) {
console.log(response.data);
});
import http.client
conn = http.client.HTTPSConnection("wahgreat.com")
payload = 'api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld'
headers = { 'Content-Type': 'application/x-www-form-urlencoded' }
conn.request("POST", "/api/send.php", payload, headers)
res = conn.getresponse()
print(res.read().decode("utf-8"))
Example Response
{
"success": "true",
"type": "API",
"totalprice": "1",
"totalgsm": "1",
"remaincredit": "998",
"results": [ { "status": "1" } ]
}
{
"success": "false",
"results": [
{ "error": "Invalid API KEY!" }
]
}
Send Images
Set type=1 to send an image, either from a live URL or an uploaded file. Supported extensions: jpg, jpeg, gif, png, svg, webp, bmp. Max file size 3 MB.
url for a hosted image link, or file to upload directly from your system (e.g. file=C:/Users/Downloads/sample.jpg).GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&type=1
&url=https://sample-videos.com/img/Sample-jpg-image-50kb.jpg
&caption=ImageCaption&priority=0
Send Documents
Set type=2 to send a document. Most extensions are supported (zip, xlsx, csv, pptx, docx and more). Max file size 3 MB, via url or a direct file upload.
GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&type=2
&url=https://www.africau.edu/images/default/sample.pdf&priority=0
Message Priority
The optional priority parameter creates a professional queue for your messages — lower values are sent first. Default value: 10.
| Value | Use case |
|---|---|
| priority = 0 | High priority, e.g. OTP messages |
| priority = 10 | General messages (default) |
| priority = 20 | Non-urgent notifications to your customers |
| priority = 30 | Non-urgent promotional offers to your customers |
| priority = 40 | Lower urgency — queued with a 40 second delay |
| priority = 60 | Lower urgency — queued with a 60 second delay |
| priority = 120 | Bulk / low urgency — queued with a 2 minute delay |
| priority = 180 | Bulk / low urgency — queued with a 3 minute delay |
| priority = 240 | Bulk / low urgency — queued with a 4 minute delay |
| priority = 300 | Lowest urgency — queued with a 5 minute delay |
Scheduled Messages
Set schedule=1 and provide schedule_time to deliver a message at a future date/time.
GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld
&schedule=1&schedule_time=2026-07-19 03:47:35&priority=0
Bulk / Personalized Messages
Set personalized=1 and pass a JSON array to message to send customized text to many recipients in a single request — each message body can be different.
GET https://wahgreat.com/api/send.php?api_key=YOUR-SECRET-API-KEY&personalized=1&priority=0
&message=[{"mobile":923101234567,"message":"Hello Ahmad Shahzad"},
{"mobile":923011234567,"message":"Hello Ali Ahmad"},
{"mobile":923331234567,"message":"Hello Mustafa Kamal"}]
Full Parameter Reference
Complete list of parameters accepted by /api/send.php.
| Parameter | Required | Description |
|---|---|---|
| api_key* | Yes | Your API key |
| mobile* | Yes | Phone with international format, e.g. 923001234567 |
| message* | Yes | Text message body (or a JSON array when personalized=1) |
| priority | No | Queue priority — see Message Priority. Default 10. |
| type | No | 0 = Text (default), 1 = Image, 2 = Document |
| url | No | Live HTTP link to the image/document (when type=1 or 2) |
| file | No | Direct file upload instead of url, e.g. file=C:/Users/Downloads/sample.jpg |
| schedule | No | Set to 1 along with schedule_time — see Scheduled Messages |
| personalized | No | Set to 1 for bulk/customized sends — see Bulk / Personalized |
Response Format
Every request returns a JSON object with a success flag and a results array.
{
"success": "true", // "true" or "false"
"type": "API",
"totalprice": "1", // messages billed
"totalgsm": "1", // recipients processed
"remaincredit": "998", // credit remaining after this request
"results": [ ... ]
}
Error Handling
When a request fails, success is "false" and results contains an object with an error message describing what went wrong.
| Example message | Typical cause |
|---|---|
Invalid API KEY! | The api_key is missing, incorrect, or has been reset |
Empty! Please Type Recipient Mobile Number! | The mobile parameter was not sent |
Empty! Please Type Your Message! | The message parameter was not sent |
success field before assuming a message was queued — see Parameters for valid value ranges.Postman Collection
Import our ready-made collection to explore every request without writing code.
Code Samples
Full working examples for sending a basic text message in every supported language.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://wahgreat.com/api/send.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'api_key=YOUR-SECRET-API-KEY&mobile=923XXX&message=HelloWorld',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'api_key': 'YOUR-SECRET-API-KEY',
'mobile': '923XXXX',
'message': 'HelloWorld'
});
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://wahgreat.com/api/send.php',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var settings = {
"url": "https://wahgreat.com/api/send.php",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"api_key": "YOUR-SECRET-API-KEY",
"mobile": "923XXXX",
"message": "HelloWorld"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
import http.client
conn = http.client.HTTPSConnection("wahgreat.com")
payload = 'api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld'
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/api/send.php", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
curl --location --request POST 'https://wahgreat.com/api/send.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'api_key=YOUR-SECRET-API-KEY' \
--data-urlencode 'mobile=923XXXX' \
--data-urlencode 'message=HelloWorld'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "api_key=YOUR-SECRET-API-KEY&mobile=923XXXX&message=HelloWorld");
Request request = new Request.Builder()
.url("https://wahgreat.com/api/send.php")
.method("POST", body)
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Imports System.Net
Imports System.Text
Module example
Sub Main()
Dim WebRequest As HttpWebRequest
WebRequest = HttpWebRequest.Create("https://wahgreat.com/api/send.php")
Dim postdata As String = "api_key={TOKEN}&mobile=&body=HelloWorld"
Dim enc As UTF8Encoding = New System.Text.UTF8Encoding()
Dim postdatabytes As Byte() = enc.GetBytes(postdata)
WebRequest.Method = "POST"
WebRequest.ContentType = "application/x-www-form-urlencoded"
WebRequest.GetRequestStream().Write(postdatabytes, 0, postdatabytes.Length)
Dim ret As New System.IO.StreamReader(WebRequest.GetResponse().GetResponseStream())
Console.WriteLine(ret.ReadToEnd())
End Sub
End Module
var options = new RestClientOptions("https://wahgreat.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/send.php", Method.Post);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("api_key", "YOUR-SECRET-API-KEY");
request.AddParameter("mobile", "923XXXX");
request.AddParameter("message", "HelloWorld");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
Support
Need help integrating? We're here.