Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending a message by the WhatsApp API using PHP

I am trying to send a message by the WhatsApp API using PHP. I have the WhatsApp password and am getting by WART using the following code:

<?php 
require "whatsapp.class.php";
// DEMO OF USAGE
$wa = new WhatsApp("91XXXXXXXXXX", "XXX-XXX", "Nick Name");
$wa->Connect();
$t = $wa->Login();
$wa->Message("5","91XXXXXXXXXX","Good code");
echo "Message sent";
?> 

I did not change anything in the whatsapp.class.php file.

My files are:

http://vvsindia.com/stackoverflow/whatsapp.class.txt
http://vvsindia.com/stackoverflow/func.txt
http://vvsindia.com/stackoverflow/decode.txt

For your convenience to view while browsing, I just uploaded them as a txt file, but originally these are PHP files.

Using the above code I was not able to send any message. What could the issue be?

like image 684
Srim Avatar asked Nov 10 '22 19:11

Srim


1 Answers

You can use the below script to send a message from WhatsApp in PHP.

https://github.com/venomous0x/WhatsAPI/tree/master/examples

Configure the source code in Apache and run examples/whatsapp.php file.

You have to change the below configurations.

// Simple password to view this script
$config['webpassword'] = 'MakeUpPassword';

and

$config['YOURNAME'] = array(
'id' => 'e807f1fcf82d132f9bb018ca6738a19f',
'fromNumber' => '441234567890',
'nick' => "YOURNICKNAME",
'waPassword' => "EsdfsawS+/ffdskjsdhwebdgxbs=",
'email' => '[email protected]',
'emailPassword' => 'gmailpassword'
);
like image 137
Jayson Avatar answered Nov 15 '22 13:11

Jayson