Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a password for whatsapp API (PHP)?

Tags:

php

whatsapi

I use this code

#!/usr/bin/php
<?php
require_once('whatsapp_whatsapi_config.php');

$destinationPhone = 'xxxx';

$w = new WhatsProt($userPhone,0, $userName, $debug);
$w->Connect();
$w->LoginWithPassword($password);
$message = 'WhatsApp';
$w->Message($destinationPhone, $message);
echo "Mensaje enviado exitosamente";
?>

and this error displayed

  PHP Fatal error:  Uncaught exception 'LoginFailureException' in       /var/www/html/whats/src/whatsprot.class.php:2274
Stack trace:
/var/www/html/whats/src/whatsprot.class.php(552): WhatsProt->doLogin()
/var/www/html/whats/whatsapp_whatsapi_send.php(13): WhatsProt->loginWithPassword('Mu7q0hq/vRSLFCU...')
{main}
  thrown in /var/www/html/whats/src/whatsprot.class.php on line 2274

I tried use the WART app but the password generated is incorrect

like image 266
Erick Vivanco Avatar asked Sep 08 '15 17:09

Erick Vivanco


1 Answers

Add a try-catch clause on the line that has $w->LoginWithPassword($password); and use the getMessage() method on the exception to see what the error message is, and what might be wrong with your login

like image 83
OskarD90 Avatar answered Sep 27 '22 19:09

OskarD90