whatsapp api请求代码未执行且未返回请求代码

时间:2013-03-12 17:13:19

标签: php exception whatsapp

我正在尝试实施whatsAPI,但我总是收到此错误 “试图请求代码时出现问题。”

以下是我的控制台中显示的完整错误:

####start of error notice#####

[12-Mar-2013 22:44:59] PHP Notice:  Undefined property: stdClass::$reason in /Applications/MAMP/htdocs/whatsapp/test/whatsprot.class.php on line 1268
[12-Mar-2013 22:44:59] PHP Fatal error:  Uncaught exception 'Exception' with message 'There was a problem trying to request the code.' in /Applications/MAMP/htdocs/whatsapp/test/whatsprot.class.php:1269
Stack trace:
#0 /Applications/MAMP/htdocs/whatsapp/test/test.php(36): WhatsProt->checkCredentials()
#1 {main}
  thrown in /Applications/MAMP/htdocs/whatsapp/test/whatsprot.class.php on line 1269

####end of error notice#####

这些是我初始化课程的凭据

$userPhone = '8801770648732';       
$userIdentity = '352264050503669';                                               
$userName = 'shishir';          
$destinationPhone = '8801713206053';                                                
$debug = TRUE;
$whatsapp = new WhatsProt($userPhone, $userIdentity, $userName, $debug);

和请求requestCode

$service_type = "sms";    
$country_code = "BD";    
$language_code = "en";    
$request_code = $whatsapp->requestCode($service_type, $country_code, $language_code);    

每次发生错误时都会遇到$whatsapp->requestCode。我不确定我做错了什么。
任何人都可以帮我吗?

1 个答案:

答案 0 :(得分:-1)

看起来你没有卷曲扩展。 checkCredentials方法抛出此异常。

检查你的phpinfo是否显示卷曲。