Whatsapp API php API request

Below is my code for CodeRequest.

$username = "91xxxxxxxxxx"; $identity = strtolower(urlencode(sha1($username, true))); $w = new WhatsProt($username, $identity, "test", true); $r = $w->codeRequest(); print_r($r); 

He gives an answer like

 stdClass Object ( [status] => sent [length] => 6 [method] => sms [retry_after] => 1805 ) 

But I do not receive the message. Any suggestions please.

My other questions.

  • Are there any restrictions on requesting a code. (Every time I use a new mobile number).
  • For example, I request a code for mobile number xxx using the galaxys3 user galaxys3 , should I request another code with yyy mobile number using the same user agent?

I am using WhatsAPI-Official

+6
source share
2 answers

Finally, I received the code on my mobile.

 $username = "91xxxxxxxxxx"; $identity = "myIdentity"; $w = new WhatsProt($username, $identity, "test", true); $r = $w->codeRequest('sms',$carrier); (or) $r = $w->codeRequest('voice',$carrier); //Voice service is fast compared to sms 

$carrier obtained from the networkinfo.csv file.

operator is nothing more than a mobile network operator (Airtel, Idea, etc.) in accordance with your mobile country code (mcc) and mobile network code (mnc).

You can get mnc and mcc codes from mobile-network-codes-country-codes

Get the mcc and mnc codes with your location and operation corresponding to them using networkinfo.csv to get the name carrier .

 Eg: My number is 919xxxxxx country - india ( Andhra Pradesh ) operator - Idea 

For the above mcc and mnc link for my number 404 & 7

Now check these codes in the networkinfo.csv file

those. 404,1028,007,7,in,India,91,Idea Cellular Ltd.4

Here 404 -> mcc and 007 -> mnc

My operator name is Idea Cellular Ltd.4

If you send the correct operator name, you will receive sms / call on your mobile.

+4
source

Try this piece of code.

  $destinationPhone = 'xxxxxxxxxxxx'; $w = new WhatsProt($userPhone, $userIdentity, $userName, $debug); $w->Connect(); $w->LoginWithPassword($password); $w->Message($destinationPhone, $argv[1]); 

or more detailed information refers to this link .. http://blog.philippheckel.com/2013/07/07/send-whatsapp-messages-via-php-script-using-whatsapi/#Send-WhatsApp-messages

0
source

Source: https://habr.com/ru/post/978436/


All Articles