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.