Send Message API

End Point: https://wbiztool.com/api/v1/send_msg/
Request Type: POST
Required Fields in Request
  • client_id (Integer) - Your Client Id (Given on Account page in API Setting Section
  • api_key (String) - Your Api Key (Given on Account page in API Setting Section
  • whatsapp_client (Integer) - Your WhatsApp Client Id (Given on Whatsapp Setting Page) Click here
  • msg_type (Integer) - 0 for Text msg, 1 for Image with msg, 2 for File with msg
  • img_url (String, Optional) - Image Url (Mandotary when msg_type is 1) and url should be ending with valid image extension (.png, .jpg, .jpeg etc)
  • file_url (String, Optional) - File Url from which file can be directly downloaded (Mandotary when msg_type is 2 and file is not uploaded)
  • file_name (String, Optional) - File Name (Mandotary when msg_type is 2)
  • file (FILE, Optional) - File(Mandotary when msg_type is 2 and file_url is not provided)
  • phone (String) - Receiver's Whatsapp Number with country code. eg: 919833371069
  • country_code (string) - Receiver's country code. eg: 91 for india, 1 for USA
  • msg (String) - Message Text
  • expire_after_seconds (Integer, Optional) - Expire message if not sent before given seconds
  • webhook (String, Optional)- Webhook Url where msg_id and status will be posted
Fields in Response
  • msg_id (Integer) - If successfully submitted your message then msg id. You can save this id to check the status of particular message. You can save it for future reference.
  • message (String) - Readable status of your request
  • status (Integer) - 0/1 if status is 0 then there is some error with this request explaination will be given in message key
Example

The following example uses curl to make an API request. Note the use of the api key, client id, whatsapp client id and the setting of the Content-Type header.

curl -X POST https://wbiztool.com/api/v1/send_msg/  -d '{
    "client_id": <your_client_id>,
    "api_key": "<your_api_key>",
    "whatsapp_client": <your_whatsapp_client_id>,
    "msg_type": 0,
    "msg": "Hi, This is a *test* msg from _WbizTool.com_",
    "phone":"9833371069",
    "country_code":"91"

}'

// Response
{"status": 1, "message": "Created", "msg_id": <unique_msg_id>}

 Normal Text Msg

import requests
data={
    "client_id" : <client_id>,
    "api_key" : "<api_key>",
    "whatsapp_client" : <whatsapp_client_id>,
    "msg_type": 0,
    "msg" : "Hi, This is a *test* msg from _WbizTool.com_",
    "phone" : "9833371069",
    "country_code":"91"
}
url = 'https://wbiztool.com/api/v1/send_msg/'
response = requests.post(url,data=data).text

 Image Text Msg with Image url

import requests
data={
    "client_id" : <client_id>,
    "api_key" : "<api_key>",
    "whatsapp_client" : <whatsapp_client_id>,
    "msg_type": 1,
    "img_url":"<img_url>",
    "msg" : "Hi, This is a *test* msg from _WbizTool.com_",
    "phone" : "9833371069",
    "country_code":"91"
}
url = 'https://wbiztool.com/api/v1/send_msg/'
response = requests.post(url,data=data).text

 Image Text Msg with Image File

import requests
data={
    "client_id" : <client_id>,
    "api_key" : "<api_key>",
    "whatsapp_client" : <whatsapp_client_id>,
    "msg_type": 1,
    "msg" : "Hi, This is a *test* msg from _WbizTool.com_",
    "phone" : "9833371069",
    "country_code":"91"
}
url = 'https://wbiztool.com/api/v1/send_msg/'
files = {'file': open('path/to/image/file', 'rb')}
response = requests.post(url,data=data,files=files).text

 File Text Msg with File url

import requests
data={
    "client_id" : <client_id>,
    "api_key" : "<api_key>",
    "whatsapp_client" : <whatsapp_client_id>,
    "msg_type": 2,
    "file_url":"<file_url>",
    "msg" : "Hi, This is a *test* msg from _WbizTool.com_",
    "phone" : "9833371069",
    "country_code":"91"
}
url = 'https://wbiztool.com/api/v1/send_msg/'
response = requests.post(url,data=data).text

 File Text Msg with File

import requests
data={
    "client_id" : <client_id>,
    "api_key" : "<api_key>",
    "whatsapp_client" : <whatsapp_client_id>,
    "msg_type": 2,
    "msg" : "Hi, This is a *test* msg from _WbizTool.com_",
    "phone" : "9833371069"
    "country_code":"91"
}
url = 'https://wbiztool.com/api/v1/send_msg/'
files = {'file': open('path/to/file', 'rb')}
response = requests.post(url,data=data,files=files).text

Normal Text Msg

$url = 'https://wbiztool.com/api/v1/send_msg/';
$myvars = 'client_id=<client_id>&api_key=<api_key>&whatsapp_client=<whatsapp_client_id>&msg_type=0&phone=9833371069&country_code=91&msg=Test';

$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);

$response = curl_exec( $ch );
echo $response;

Image Text Msg With Image Url

$url = 'https://wbiztool.com/api/v1/send_msg/';
$myvars = 'client_id=<client_id>&api_key=<api_key>&whatsapp_client=<whatsapp_client_id>&phone=9833371069&country_code=91&msg=Test&msg_type=1&img_url=<img_url>';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);

$response = curl_exec( $ch );
echo $response;

Image Text Msg With Image File

$url = 'https://wbiztool.com/api/v1/send_msg/';
$myvars = 'client_id=<client_id>&api_key=<api_key>&whatsapp_client=<whatsapp_client_id>&phone=9833371069&country_code=91&msg=Test&msg_type=1';
$fp = fopen('/my/folder/flower.png', 'wb');
$ch = curl_init( $url );
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);

$response = curl_exec( $ch );
echo $response;

File Text Msg With File Url

$url = 'https://wbiztool.com/api/v1/send_msg/';
$myvars = 'client_id=<client_id>&api_key=<api_key>&whatsapp_client=<whatsapp_client_id>&phone=9833371069&country_code=91&msg=Test&msg_type=2&file_url=<file_url>';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);

$response = curl_exec( $ch );
echo $response;

File Text Msg With File

$url = 'https://wbiztool.com/api/v1/send_msg/';
$myvars = 'client_id=<client_id>&api_key=<api_key>&whatsapp_client=<whatsapp_client_id>&phone=9833371069&country_code=91&msg=Test&msg_type=2';
$fp = fopen('/my/folder/invoice.pdf', 'wb');
$ch = curl_init( $url );
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);

$response = curl_exec( $ch );
echo $response;
require 'net/http'

params = {
	client_id: "<client_id>",
	api_key: "<api_key>",
	whatsapp_client: "<whatsapp_client_id>",
	msg_type: 0,
	msg: "Hi, This is a *test* msg from _WbizTool.com_",
	phone: "919833371069",
        country_code:"91",
}
url = 'https://wbiztool.com/api/v1/send_msg/'
uri = URI(url)
res = Net::HTTP.post_form(uri, params)
JSON.parse(res.body)
                                                    <ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
<li class="nav-item">
<a href="#home1" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
<i class="mdi mdi-home-variant d-md-none d-block"></i>
<span class="d-none d-md-block">Home</span>
</a>
</li>
<li class="nav-item">
<a href="#profile1" data-toggle="tab" aria-expanded="true" class="nav-link rounded-0 active">
<i class="mdi mdi-account-circle d-md-none d-block"></i>
<span class="d-none d-md-block">Profile</span>
</a>
</li>
<li class="nav-item">
<a href="#settings1" data-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
<i class="mdi mdi-settings-outline d-md-none d-block"></i>
<span class="d-none d-md-block">Settings</span>
</a>
</li>
</ul>

<div class="tab-content">
<div class="tab-pane" id="home1">
<p>...</p>
</div>
<div class="tab-pane show active" id="profile1">
<p>...</p>
</div>
<div class="tab-pane" id="settings1">
<p>...</p>
</div>
</div>