【问题标题】:whatsapp api request code not executing and not returning a request codewhatsapp api请求代码未执行且未返回请求代码
【发布时间】:2013-02-28 08:24:21
【问题描述】:

我正在尝试实现 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 时都会出现该错误。
我不确定我做错了什么。
谁能帮我解决这个问题?

【问题讨论】:

  • 这个问题我也需要回答
  • 我也是............

标签: php exception whatsapp


【解决方案1】:

您似乎没有 curl 扩展名。 这个异常是由checkCredentials 方法抛出的。

检查你的 phpinfo 是否显示 curl。

【讨论】:

  • 缺少 cURL 应该会显示非常非常清晰的错误消息。我怀疑这里的情况。
猜你喜欢
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多