Skip to main content

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 GuzzleHttpExceptionClientException: 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): GuzzleHttpExceptionRequestException::create(Object(GuzzleHttpPsr7Request), Object(GuzzleHttpPsr7Response), NULL, Array, NULL)

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

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




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.


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

Thanks.


Reply