Skip to content
No description, website, or topics provided.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
example.php
whatsapp_class.php Add files via upload Apr 22, 2019

README.md

Steps to configure

Generate Token from [https://www.whatsappapi.in] & Configure parameter in whatsapp_class.php file as below

/* Change This Parameter */
$apiToken = 'Your-Token'; // eg. 3546534354354
$fromNumber = 'Your-WhatsApp-Number'; eg. 919876****
/* Change This Parameter */

Call functions as below to send text message, image or pdf file in whatsapp

/* Include Class for call whatsappapi.in API */
require_once('whatsapp_class.php');


// 1. Code for send simple text message
$whatsapp_obj = new WhatsAppAPI();
$apiResponse = $whatsapp_obj->sendText($country_code = '91', $to_mobile = '987654****', $message = 'Simple Text Message');


// 2. Code for send image (.png or .jpg file allowed)
$whatsapp_obj = new WhatsAppAPI();
$apiResponse = $whatsapp_obj->sendImage($country_code = '91', $to_mobile = '987654****', $message = 'https://www.whatsappapi.in/front-assets/img/logo.png');


// 3. Code for send pdf file (.pdf)
$whatsapp_obj = new WhatsAppAPI();
$apiResponse = $whatsapp_obj->sendImage($country_code = '91', $to_mobile = '987654****', $message = 'https://www.whatsappapi.in/dummy.pdf');
You can’t perform that action at this time.