How to get password for whatsapp API (PHP)?

I am using 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 is 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 to use the WART application, but the generated password is incorrect

+7
php whatsapi
source share
1 answer

Add a try-catch clause to the line with $w->LoginWithPassword($password); and use the getMessage () method to throw an exception to find out what the error message is and what might be wrong when you log in

+1
source share

All Articles