question

Kenneth Toh avatar image
Kenneth Toh asked Kenneth Toh answered

Unable to forward calls using API

I upgraded to the latest RingCentral PHP SDK to support the JWT auth. Using the same code but modified to authenticate with JWT, it now fails to forward calls when the Webhook is triggered by the incoming call. Session and party IDs are from the Webhook data send by RingCentral.

The following error was thrown. Do you know what is causing this?

[24-Jan-2024 17:45:18 Australia/Sydney] PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://platform.ringcentral.com/restapi/v1.0/account/~/telephony/sessions/s-a0d854f1c5bd0z18d3a37330bz1071d5a0000/parties/p-a0d854f1c5bd0z18d3a37330bz1071d5a0000-2/forward` resulted in a `403 Forbidden` response:

{

"errors" : [

{

"errorCode" : "TAS-106",

"message" : "Operation is not allowed"

}

] (truncated...)

in /var/www/html/ring-central/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack trace:

#0 /var/www/html/ring-central/vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response), NULL, Array, NULL)

#1 /var/www/html/ring-central/vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))

#2 /var/www/html/ring-central/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler(1, Object(Gu in /var/www/html/ring-central/vendor/ringcentral/ringcentral-php/src/Http/Client.php on line 52




rest apicall forwardingwebhooks
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

Make sure the JWT token is generated by the user extension who receives the call. Call forwarding cannot be handled by other (even a super admin user) user extension than the owner of the call.

1 |3000

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

Kenneth Toh avatar image
Kenneth Toh answered

Using the token generated by the user that RingCentral used to trigger the Webhook fixes the problem.

Thanks.

1 |3000

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

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