我正在尝试使用 Liveperson REST API,我使用以下 php 代码:
$authorization = "LivePerson appKey=MY_APP_KEY";
$accept = "application/xml";
$contentType = "application/xml";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "C:/dev/wamp/exported.crt");
curl_setopt($ch, CURLOPT_URL, "https://dev.liveperson.net/api/account/1234?v=1");
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: '.$authorization,'Accept: '.$accept,'Content-Type: '.$contentType));
curl_exec($ch);
$response = curl_getinfo( $ch );
var_export($response);
curl_close($ch);
请求失败,我已经尝试了以下
- 在 php.ini 上启用 openssl
- 从 liveperson 服务器导出证书并在我的代码中使用它
- 按照此处的说明进行操作
任何帮助将不胜感激!