question

ken-nye6499 avatar image
ken-nye6499 asked ken-nye6499 commented

Using PHP-SDK, getting error 500

Im tying to use the PHP-SDK to upload a greeting, I installed the SDK but Im getting error 500 every time I use any script. If I just have a basic PHP page, they load fine. Is there a way of testing the installation of the SDK?

sdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ken-nye6499 avatar image
ken-nye6499 answered

I found the logs and this is the error

[11-Jul-2022 14:50:38 America/Los_Angeles] PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://platform.devtest.ringcentral.com/restapi/oauth/token in C:\SNC\php\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211

how to a get around this problem?

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered ken-nye6499 commented
3 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ken-nye6499 avatar image ken-nye6499 commented ·

thanks, that worked, now I have a more basic PHP issue. Im not a pro at PHP, but Im trying. Im trying to get basic extension information working. I got this code from the 'try it now' I get no errors and a blank page, I assume I need more code to view the response.

require('vendor/autoload.php');
$rcsdk = new RingCentral\SDK\SDK($client_id, $client_secret, RingCentral\SDK\SDK::SERVER_SANDBOX);$platform = $rcsdk->platform();
$platform->login($Accountnumber, $extension, $pw);
$r = $platform->get("/restapi/v1.0/account/{$accountId}/extension", $queryParams);
// PROCESS RESPONSE

I tried to add this code , but it still comes back blank

foreach ($r as $value){ 
  echo "value " .$value . "
";
} 

any help would be much appreciated.

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ ken-nye6499 commented ·

Try this after logged in. And don't hardcode the account id as you may make a mistake, use the tilde instead and the system will detect the account id based on the access token.

$resp = $platform->get('/account/~/extension/?page=1&perPage=1000');
foreach ($resp->json()->records as $record)
  print_r (json_encode($record, JSON_PRETTY_PRINT) . "\n");
0 Likes 0 ·
ken-nye6499 avatar image ken-nye6499 Phong Vu ♦♦ commented ·

thanks, that worked perfect

0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys