1

Alright, I am working on a WhatsAPP communicator for a client and I've got the data from the request via CURL but it seems that the ID is encoded in something I don't know?

Looking for any input on this, do I need to set an accesstoken for the SSL ?

$num = $_GET['num'];
$cc = $_GET['cc'];
$url = "https://v.whatsapp.net/v2/exist?in={$num}&cc={$cc}";
$accesstoken = randstr(40);
$headers = array();
$headers[] = 'Content-type: application/json';



//cURL starts
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$reply = curl_exec($ch);

//error handling for cURL
if ($reply === false) {
   // throw new Exception('Curl error: ' . curl_error($crl));
   print_r('Curl error: ' . curl_error($ch));
}
curl_close($ch);

$data = json_decode($reply, true);

I have it replying

Array ( [status] => created [id] => giHIL4Cc2HahImIOSPDA7l4t8a4= [sms_length] => 6 [voice_length] => 6 )

But I'm unsure if it's replying correctly, or if I should randomize the user agent, I'm stuck looking for some direction finding.

Ryan
  • 25
  • 5
  • What's wrong with the id you got back? – PeeHaa Nov 20 '14 at 22:54
  • first of all it's different everytime; and I'm not sure what it's encoded in. I'll do 5 runs of script on same number. 1. Array ( [status] => created [id] => 0QvPYEpEkDXM+Ck1tfTUj3tu0lI= [sms_length] => 6 [voice_length] => 6 ) 2. Array ( [status] => created [id] => MBeokfOgojk8Pi6CtMkYk6PDpzc= [sms_length] => 6 [voice_length] => 6 ) 3. Array ( [status] => created [id] => AOjgfT0adwie+aJn7pwDltEZ7EM= [sms_length] => 6 [voice_length] => 6 ) – Ryan Nov 20 '14 at 23:08

0 Answers0