Created for Business

ZAPI is designed to create chat bots and integrate WhatsApp with business systems: CRM, ERP or a website. ZAPI is already used for many projects: sending and reading text from the CRM-system, recording in the beauty salon, sending details of the vacancy or chat-bot with promotional codes.


Null

Setting Up WhatsApp via ZAPI



In order to connect WhatsApp to our API, you will need the following:
1. A WhatsApp or WhatsApp Business account
2. The WhatsApp or WhatsApp Business app installed on your phone
3. A ZAPI account

If you do not already have a ZAPI account, click here and fill out the required fields. Once you have entered your desired login information, 
click on the green "GET STARTED" button.

Once you are logged onto ZAPI, you will have to create a new Instance. In doing so, you will be asked to scan your WhatsApp Web code to connect your WhatsApp account to ZAPI. 
							
Null

API for developers

Create a chat bot in a couple of hours or integrate into 6,000 dialogs per day in PHP, JavaScript, Google Docs, Python, Java, C# or even VBA.

Set a Webhook

Receive notifications about personal and group text through incoming http requests to your server. This is the main function for creating a chatbot.

// First of all - set a webhook to URL like http://your_website.com/my_webhook_url.php

// Parse a webhook data

$data = json_decode(file_get_contents('php://input'), true);
$message = $data['text']; //message that has been send by a whatsapp user
$sender = $data['user']; //whatsapp user number

if($message == 'hello') //what happens when user says hello
{
$reply = 'Welcome...this is my new chatbot'; //reply message
$fire = json_encode([["text" => "$reply", "type" => 'message']]); //encoding data
echo $fire; //firing back a reply 
}
else //what happens if user did not say hello
{
  
$reply = 'Payload fired but no data';
$fire = json_encode([["text" => "$reply", "type" => 'message']]);
echo $fire;
}
// First of all - set a webhook to URL like http://your_website.com/my_webhook_url

// Require Express JS и Body Parser for JSON POST acceptance
var app = require('express')();
var bodyParser = require('body-parser');
app.use(bodyParser.json());

// Handle POST request
app.post('/my_webhook_url', function (req, res) {
    var data = req.body; // New text in the "body" variable
    for (var i = 0; i < data.text.length; i++) { // For each text
        var text = data.text[i];
        console.log(text.user + ': ' + text.body); //Send it to console
    }
    res.send('Ok'); //Response does not matter
});

app.listen(80);

Send a text

To a phone number connected to WhatsApp or to a group chat.

$data = [
    'phone' => '263784437431', // Receivers phone
    'body' => 'Hi , there!', // text
];
$json = json_encode($data); // Encode data to JSON
// URL for request POST /text
$url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
// Make a POST request
$options = stream_context_create(['http' => [
        'method'  => 'POST',
        'header'  => 'Content-type: application/json',
        'content' => $json
    ]
]);
// Send a request
$result = file_get_contents($url, false, $options);
var request = require('request'); //bash: npm install request
// URL for request POST /text
var url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
var data = {
    phone: '263784437431', // Receivers phone
    body: 'Hi , there!', // Сообщение
};
// Send a request
request({
    url: url,
    method: "POST",
    json: data
});
// URL for request POST /text
var url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
var data = {
    phone: '263784437431', // Receivers phone
    body: 'Hi , there!', // text
};
// Send a request
$.ajax(url, {
    data : JSON.stringify(data),
    contentType : 'application/json',
    type : 'POST'
});
curl \
-d '{"phone": "263784437431","body": "Hi , there!"}' \ # Phone and text
-H "Content-Type: application/json" \ # Headers
-X POST \ # Type = POST
"https://api.tpjezy.co.zw/text?key=jkjs748746" # URL for request POST /text

Read text

History of WhatsApp conversations in personal and group chats, including before connecting the API.

// URL for request GET /text
$url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
$result = file_get_contents($url); // Send a request
$data = json_decode($result, 1); // Parse JSON
foreach($data['text'] as $text){ // Echo every text
    echo "Sender:".$text['user']."<br>";
    echo "text: ".$text['body']."<br>";
}
var request = require('request');// npm install request
var url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
request(url, function (error, response, body) { // Make a GET request
    if (error) return console.error('HTTP Error', error);
    // Parse a response
    var data = JSON.parse(body);
    // For each text
    for (var i = 0; i < data.text.length; i++) {
        var text = data.text[i];
        console.log(text.user + ': ' + text.body); //Send it to console
    }
});
var url = 'https://api.tpjezy.co.zw/text?key=jkjs748746';
$.get(url, function (data) { // Make a GET request
    for (var i = 0; i < data.text.length; i++) { // For each text
        var text = data.text[i];
        console.log(text.user + ': ' + text.body); //Send it to console
    }
});
# Just a GET request
curl "https://api.tpjezy.co.zw/text?key=jkjs748746"
chat

Messaging

Use WhatsApp messaging to reliably send mission critical text from flight notifications to booking confirmations and delivery alerts.

verified_user

Security

ZAPI supports encryption to protect communications between ZAPI and your web application. Just specify an HTTPS URL.

fingerprint

Convinience

ZAPI for WhatsApp Beta. Easy, reliable, secure, and Free WhatsApp messaging.

How to not get Banned?

WhatsApp knows that it's uncommon for someone to send so many text or bulk text to people they've never talked to each other before so it considers as spam/marketing junk pretty fast. There is some tips before sending text to WhatsApp.

Dos and Don'ts:

  1. Important: Do NOT send text which get you a report. As long as you don't getting reports from users who you sent text to, your account will be mostly fine.
  2. Have a real content, a survey that the person agreed with is different than a marketing text on a saturday night.
  3. Send text written in different ways, you could make a script that places spacebars randomly on your string AND include the person's (first) name
  4. Never use fixed times, always go for sending the first text, wait a random time between 30 ~60 seconds and then send the second text
  5. Always try to group contacts by their area code, WhatsApp expects a regular person to talk mostly with contacts that are within the same area of your phone number.
  6. Have a profile picture, this is not related to WhatsApp Bots Catcher® but sending a new text for someone not having a picture/name/status will elevate your chances of being manually tagged as spam.
  7. Send "seen" confirmation to text or disable it on WhatsApp
  8. Avoid sending links that were previously marked as spam on WhatsApp or non-HTTPS. A URL shortener is a good idea
  9. IMPORTANT: It's really bad if you send text 24/7 without giving it some time to wait. Random belays between text are not enough, send a resonable amount of text keeping in mind your conversions rate, for exemple: for one hour send a maximum of 4 text per contact that have replied to your text, stop sending text for one hours, then start again. Again, don't send text without stopping for a while between every "package"
  10. Send only one short text when starting a conversation, one should not send long text or multiple text without the user conscenting
  11. Avoid prefixes for text

Have in mind:

  1. For everyone you send a text that doesn't have your number on their contact list will be asked it that's spam, being tagged as spam a few times (5 - 10) will definitely get you banned
  2. WhatsApp records every movement you do, you can even check the logs when sending simple support email, it contains all kinds of information, this said: act as human as possible
  3. Try to engage in conversations, as long as you send a text and the person doesn't automatically blocks you it'll be quite okay. People constantly talking to you and adding you to their contact list will make your number stronger against a ban
  4. Think about that like a points system, you start with zero points (negative if your device were previously blacklisted), if you reach below zero you are out, if you engage in conversations you get a point, if you are tagged as spam you lose some points, if you are blocked you may lose more points
  5. Finally, If your content is clearly spam, it doesn't matter if you are using a broadcast list, group or direct contact, you will still be banned

As API provider we say all that's left to do right now is agreeing with WhatsApp's policy, not sending spam text and always wait for the other person to contact you first. You could make it by sending an SMS to the person with a link to start a chat on WhatsApp with you.

Work with us

At ZAPI each of us strives for better in everything we do. It's how we approach our work with each other and with our clients.