我創建了一個Server-only (No UI)
專用的應用程序,以讀取通話記錄的權限,並且在登錄時發出我收到以下錯誤:RingCentral API登錄返回無效響應字符串
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);