我创建了一个Server-only (No UI)
具有读取呼叫日志权限的私有应用程序,当登录时出现以下错误:
Exception: Invalid response string SDK HTTP Error at https:///platform.devtest.ringcentral.com/restapi/oauth/token Response text:
Previous: Invalid response string #0 /srv/www/vhosts/internal.kingscredit.com/includes/ringcentral-php-master/vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(214):
RingCentral\SDK\Http\Client->send(Object(RingCentral\Psr7\Request))
\#1 /srv/www/vhosts/internal.kingscredit.com/includes/ringcentral-php-master/vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(301):
RingCentral\SDK\Platform\Platform->sendRequest(Object(RingCentral\Psr7\Request),
Array) #2 /srv/www/vhosts/internal.kingscredit.com/includes/ringcentral-php-master/vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(123):
RingCentral\SDK\Platform\Platform->requestToken('/restapi/oauth/...', Array) #3 /srv/www/vhosts/internal.kingscredit.com/includes/ringcentral-php-master/demo/callRecording.php(25):
RingCentral\SDK\Platform\Platform->login('+15188315198', 101, 'xxxxxxxxxxxx', true) #4 {main}
我错过了什么?为什么我会收到此错误?这是代码:
require_once('_bootstrap.php');
use RingCentral\SDK\SDK;
// Create SDK instance
$credentials = array(
'username' => '+15188315198', // your RingCentral account phone number
'extension' => 101, // or number
'password' => 'xxxxxxxxxxxx',
'appKey' => 'xxxxxxxxxxxxxxx',
'appSecret' => 'xxxxxxxxxxx',
'server' => 'https:platform.devtest.ringcentral.com',
'dateFrom' => '1/1/2016'
);
$rcsdk = new SDK($credentials['appKey'], $credentials['appSecret'], $credentials['server'], 'Demo', '1.0.0');
$platform = $rcsdk->platform();
$platform->login($credentials['username'], $credentials['extension'], $credentials['password'], true);