More effective than SMS. Get more feedback and sales from your customers
Whatsapp-api allows you to easily and quickly generate sales, chat and other bots on whatsapp for businesses and other users.
A great solution to serve your customers 24/7 via Whatsapp.
Whatsapp-api is very easy to use and our support line is here for you.
Manage your Whatsapp number for just $ 0.66 a day.
Easy api is very easy and fast to use.
$data = [
'phone' => '+441777889944', // Receiver
'body' => 'Hello, this is a test message!', // Message
];
$url = 'https://api.wha-api.com/message?token=MIuv70gkAN';
$options = stream_context_create(['http' => [
'method' => 'POST',
'header' => 'Content-type: application/json',
'content' => json_encode($data) // Encoding JSON
]
]);
// Start http request
$response = file_get_contents($url, false, $options);
// URL for request GET /messages
$url = 'https://api.wha-api.com/messages?token=MIuv70gkAN';
$result = file_get_contents($url); // Send a request
$data = json_decode($result, 1); // Parse JSON
foreach($data['messages'] as $msg){
echo "Sender:".$msg['author'];
echo "Message: ".$msg['body'];
}
// Parse a webhook data
$data = json_decode(file_get_contents('php://input'), true);
foreach($data['messages'] as $message){
// Handle every message here
// Add to the database or generate a response
}
var request = require('request');
// URL for request POST /message
var token = ' MIuv70gkAN';
var url = 'https://api.wha-api.com/sendMessage?token='+token;
var data = {
phone: '38098888788', // Receivers phone
body: 'Hello, This is my first message!'
};
// Send a request
request({
url: url,
method: "POST",
json: data
});
var request = require('request');
// URL for request POST /message
var token = ' MIuv70gkAN';
var url = 'https://api.wha-api.com/messages?token=' + token;
request(url, function (error, response, body) { // Make a GET request
if (error) return console.log(error);
// Parse a response
var data = JSON.parse(body);
// For each message
for (var i = 0; i < data.messages.length; i++) {
var message = data.messages[i];
console.log('Sender ' + message.author);
console.log('Sender ' + message.body);
}
});
var app = require('express')();
var bodyParser = require('body-parser');
app.use(bodyParser.json());
// POST request
app.post('/my_webhook_url', function (req, res) {
var data = req.body; // New messages in the "body" variable
for (var i = 0; i < data.messages.length; i++) { // For each message
var message = data.messages[i];
console.log(message.author + ': ' + message.body); //Send it to console
}
res.send('Ok');
});
app.listen(80);
More than 500 small businesses and developers are using Wha-api. Wha-api is always an ideal solution for flexible and practical solutions.
Join the wha-api family. Make the difference and stay ahead.
We are providing free WHA-API trial for 3 days. You can send up to 200 text messages with the trial version. It can increase up to 7000 text messages per day upon purchase. Please contact with us if you need more than 3 days or more than 5 accounts for trial.