venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.13k forks source link

Problem with integrate with WhatsAPI - v.whatsapp.net/v2 #810

Open abdulla2013 opened 10 years ago

abdulla2013 commented 10 years ago

Hello,

I had an issue with doing some integration with WhatsAPI, I have this whatsapp link to check the number: https://v.whatsapp.net/v2/exist?in=****&cc=** it is working fine without any issue, as showing: {"status":"created","id":"+wl5i8QcMWyI8chvty2hzxg667M=","sms_length":6,"voice_length":6}

The problem is when I make PHP script to link it with WhatsAPI, and call php it is showing: {"status":"fail","reason":"blocked"}

I try to called php file itself, showing same:

This is the PHP file:

<?php function curl_get_contents($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $data = curl_exec($ch); curl_close($ch); return $data; } $url = "https://v.whatsapp.net/v2/exist?in=*****&cc=***"; $json = curl_get_contents($url); echo $json;

?>

What exact the issue are? is there any header I need to do? Can you test it in your container?

-Abdulla

blueslmj commented 10 years ago

use checkCredentials() to check numbers

abdulla2013 commented 10 years ago

Hello, I do not want to run it via a number after authentication using checkCredentials() , because I have seen multiple of issues blocking numbers after they run checkCredentials() even they did not send any messages, so the way that I used not asking for any authentication or numbers.

Is I am right @blueslmj

-Abdulla

blueslmj commented 10 years ago

checkCredentials() just use to get informations from whatsapp's server, does not affect anything

abdulla2013 commented 10 years ago

@blueslmj Can you give me the code that can be used to? for example we just need to write: checkCredentials($number) where $number is the mobile number? -Abdulla

mgp25 commented 10 years ago

nah, the procedure is:

$wa = new WhatsProt($username, $identity, $nickname, $debug);
$wa->connect();
$wa->loginWithPassword($password);
$wa->checkCredentials();

Note that the password change if you call that function

abdulla2013 commented 10 years ago

@mgp25 Thank you, but this is for checking my number I think!! What I need is to check if this number is correct, whatever it has whatsapp or not!

So, for example, if the user send his number I can see it is wrong format or not, Using this link for example: https://v.whatsapp.net/v2/exist?in=****&cc=**

Hope you got my point!

mgp25 commented 10 years ago

Then use contactsync.php, it will tell you if the user has whatsapp or not

abdulla2013 commented 10 years ago

Hi, @mgp25 getting white page, I do not know why. the link that I used: contactsync.php?phone=****&pass=****&u[]=999999999999999

But it is loading for few seconds then white page. is there any issue with this file, you think?

mgp25 commented 10 years ago

@abdulla2013

contactsync.php?phone=YOURPHONE&pass=YOURPASSWORD&u[]=NUMBER1&u[]=NUMBER2  ...

Real numbers.

abdulla2013 commented 10 years ago

Still getting white page, when I turn the debug; it is showing: in the last

Only!

mgp25 commented 10 years ago

Seems that you are not logging in

mrssam commented 9 years ago

hi mgp25 , i thanks for you help, but if any one need to use contactsync.php with POST method not withe $_GET is this possible if , yes please tell us how we use it please and can i use and what's the correct format of u[] can you tell us example please best regards

mgp25 commented 9 years ago

Yes, it's possible. read this: php.net/manual/es/reserved.variables.post.php

souhailimnher commented 6 years ago

i tis work now or no ?