mgp25 - Whatsapp ChatAPI "bad_token" bug

chat api
whatsapp api php free download
whatsapp business api
whatsapp web api
whatsapp token
whatsapp webhook
whatsapp crm
chat api for website

I've googled this to death...

Am doing the initial "codeRequest". Cannot get past "bad_token".

I’ve checked all the values and tried all the versions/ classesMd5 I can find. Have also downloaded the APK myself and calculated the MD5.

I’m just wondering if WhatsApp have completely changed the token algorithm or something? If anyone actually has this working I’d love to hear from you!

token.php

$waPrefix   = "Y29tLndoYXRzYXBw";
$signature  = 'MIIDMjCCAvCgAwIBAgIETCU2pDALBgcqhkjOOAQDBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMRYwFAYDVQQKEw1XaGF0c0FwcCBJbmMuMRQwEgYDVQQLEwtFbmdpbmVlcmluZzEUMBIGA1UEAxMLQnJpYW4gQWN0b24wHhcNMTAwNjI1MjMwNzE2WhcNNDQwMjE1MjMwNzE2WjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xhcmExFjAUBgNVBAoTDVdoYXRzQXBwIEluYy4xFDASBgNVBAsTC0VuZ2luZWVyaW5nMRQwEgYDVQQDEwtCcmlhbiBBY3RvbjCCAbgwggEsBgcqhkjOOAQBMIIBHwKBgQD9f1OBHXUSKVLfSpwu7OTn9hG3UjzvRADDHj+AtlEmaUVdQCJR+1k9jVj6v8X1ujD2y5tVbNeBO4AdNG/yZmC3a5lQpaSfn+gEexAiwk+7qdf+t8Yb+DtX58aophUPBPuD9tPFHsMCNVQTWhaRMvZ1864rYdcq7/IiAxmd0UgBxwIVAJdgUI8VIwvMspK5gqLrhAvwWBz1AoGBAPfhoIXWmz3ey7yrXDa4V7l5lK+7+jrqgvlXTAs9B4JnUVlXjrrUWU/mcQcQgYC0SRZxI+hMKBYTt88JMozIpuE8FnqLVHyNKOCjrh4rs6Z1kW6jfwv6ITVi8ftiegEkO8yk8b6oUZCJqIPf4VrlnwaSi2ZegHtVJWQBTDv+z0kqA4GFAAKBgQDRGYtLgWh7zyRtQainJfCpiaUbzjJuhMgo4fVWZIvXHaSHBU1t5w//S0lDK2hiqkj8KpMWGywVov9eZxZy37V26dEqr/c2m5qZ0E+ynSu7sqUD7kGx/zeIcGT0H+KAVgkGNQCo5Uc0koLRWYHNtYoIvt5R3X6YZylbPftF/8ayWTALBgcqhkjOOAQDBQADLwAwLAIUAKYCp0d6z4QQdyN74JDfQ2WCyi8CFDUM4CaNB+ceVXdKtOrNTQcc0e+t';

//$classesMd5 = '14w/wF67XBf2vTc+qALwKQ=='; // 2.16.148
//$classesMd5 = '1I2weuZmVg+uL50+HXeSJw=='; // 2.16.328
//$classesMd5 = 'ry9Xz6kVioQctwA3G9z62Q=='; // 2.12.556
//$classesMd5 = 'IdHZifpmNTVVCJ50Cu7RMA=='; // 2.17.350
$classesMd5 = 'uxy2TKugqw984dWE55M7fw=='; // 2.16.24

$key2 = base64_decode('eQV5aq/Cg63Gsq1sshN9T3gh+UUp0wIw0xgHYT1bnCjEqOJQKCRrWxdAe2yvsDeCJL+Y4G3PRD2HUF7oUgiGo8vGlNJOaux26k+A2F3hj8A=');

and

Constants.php

const DEVICE = 'armani';                                                                 
const WHATSAPP_VER = '2.16.24';                                                              
const OS_VERSION = '5.1.1';
const MANUFACTURER = 'OnePlus';
const BUILD_VERSION = 'YOG4PAS3JL';
const PLATFORM = 'Android';                                                                  
const WHATSAPP_USER_AGENT = 'WhatsApp/2.16.24 Android/5.1.1 Device/OnePlus-A0001'; 

I'm pretty sure these are the relevant values, primarily: WHATSAPP_VER, WHATSAPP_USER_AGENT and $classesMd5

Can anyone help? Thanks

Tried it this morning and it's working now.

Maybe I triggered some kind of block yesterday while testing.

WhatsAPI Documentation · mgp25/Chat-API Wiki · GitHub, WhatsApp's Private API. Contribute to mgp25/Chat-API development by creating an account on GitHub. What is WhatsApp? According to the company: “WhatsApp Messenger is a cross-platform mobile messenger that replaces SMS and works through the existing internet data plan of your device. WhatsApp is available for iPhone, BlackBerry, Android, Windows Phone, Nokia Symbian60 & S40 phones.

I tried this one and I got the code by SMS

constants.php

const DEVICE = 'oppo';                      // The device name.
const WHATSAPP_VER = '2.18.154';            // The WhatsApp version.
const OS_VERSION = '5.1.1';
const MANUFACTURER = 'oppo';
const BUILD_VERSION = 'A37fEX_11_171209';
const PLATFORM = 'Android';                 // The platform name.
const WHATSAPP_USER_AGENT = 'WhatsApp/2.18.154 Android/5.1.1 Device/oppo-A37f';

token.php

$classesMd5 = 'LzjhvO17H+9KeBTuY363Ow=='; // 2.18.154
$key2 = base64_decode('eQV5aq/Cg63Gsq1sshN9T3gh+UUp0wIw0xgHYT1bnCjEqOJQKCRrWxdAe2yvsDeCJL+Y4G3PRD2HUF7oUgiGo8vGlNJOaux26k+A2F3hj8A=');

Chat API WhatsApp API: How To Use the API, Our API works on the basis of the WhatsApp WEB protocol and eliminates the ban as when using libraries from mgp25 and the like. At the same time, we  WhatsApp's Private API. Contribute to mgp25/Chat-API development by creating an account on GitHub.

After 9 Hours of R&D, Finally Got the Fruitful Results. Changes are on ClassessMD5

    public const string WhatsAppVer = "2.18.154";
    /// The port that needs to be connected to
    public const int WhatsPort = 443;
    public const string Device = "Android";
    /// manufacturer
    public const string Manufacturer = "Xiaomi";
    /// OS Version
    public const string OS_Version = "5.1.1";
    public const string UserAgent = "WhatsApp/2.18.154 Android/6.0 Device/Xiaomi-HM_1SW";


string token = "PdA2DJyKoUrwLw1Bg6EIhzh502dF9noR9uFCllGk1447796090073" + number;
var classesMd5 = "LzjhvO17H+9KeBTuY363Ow=="; // 2.18.154

Whatsapp PHP SDK by mgp25, The Whatsapp PHP SDK by mgp25 interacts unofficially with the API to send messages Related APIs Whatsapp Chat API Daemon REST API. The .NET WhatsApp library . Contribute to mgp25/Chat-API-NET development by creating an account on GitHub.

How to build a chat app like WhatsApp in Android, iOS & Web?, ). DSL ensures network security and also helps in preventing private data transfer. As and when message is sent, it is queued on the server. WhatsApp's Private API. Contribute to mgp25/Chat-API development by creating an account on GitHub.

How does WhatsApp account work?, on a new device, it will ask you for your phone number. When you login to a new device with same phone number, your account will get logged out from your old device. WhatsApp's Private API. Contribute to mgp25/Chat-API development by creating an account on GitHub.

Twilio API for WhatsApp, enabled numbers page. Optionally, on the same page, you can configure a Fallback URL. According to the company: WhatsApp Messenger is a cross-platform mobile messenger that replaces SMS and works through the existing internet data plan of your device. WhatsApp is available for iPhone, BlackBerry, Android, Windows Phone, Nokia Symbian60 & S40 phones.

Comments
  • Can i know where you where you download the latest chat-api? Cause my constants.php seen diff with yours.
  • I updated my Constants.php with a mixture of values I got from various searches. WHATSAPP_VER and WHATSAPP_USER_AGENT need to work together but the others I think don't do much. That said, support for this API has ended and WhatsApp could disable it easily so I'd recommend not using it. I'm looking for a different solution.