I have this code:
require_once dirname(__FILE__)."/Chat-API-master/src/Registration.php";
$username = '972********'; // Your number with country code, ie: 34123456789
$nickname = 'A****'; // Your nickname, it will appear in push notifications
$debug = true; // Shows debug log, this is set to false if not specified
$log = true; // Enables log file, this is set to false if not specified
$dst = '+9725******';
$code = '17****';
$password="";
//$w = new WhatsProt($username, $nickname, $debug, $log);
$r = new Registration($username, $debug);
//$r->codeRequest('sms'); // could be 'voice' too
//$result=$r->codeRequest('sms'); // could be 'voice' too
$r->codeRegister($code);
I took the library from this link:
https://github.com/WHAnonymous/Chat-API/wiki/WhatsAPI-Documentation
I applied the code execution as it is described. I receieved the SMS, then I used the register function, and I got this error.
Fatal error: Uncaught exception 'Exception' with message 'An error occurred registering the registration code from WhatsApp. Reason: missing' in C:\xampp\htdocs\WhatsUp\Chat-API-master\src\Registration.php:181 Stack trace: #0 C:\xampp\htdocs\WhatsUp\index.php(19): Registration->codeRegister('175746') #1 {main} thrown in C:\xampp\htdocs\WhatsUp\Chat-API-master\src\Registration.php on line 181
The response that I should be getting is a password (parameter that is called 'pwd'). I also used their two tools that are described in the link.
You can also use WART, you can download from here: /mgp25/WART
Or you can use this online tool: watools
The picture below shows the response that I got.
Why am I getting those errors. Where does this code go wrong? and if the framework doesnt work! what framework is there that works well?
I just need a simple code that sends a simple whatsapp message.