I am writing a PHP application using the Official PHP SDK and the Oauth authorization flow.
When I have both a valid access token and a valid refresh token, I am able to call the PHP SDK's platform->refresh() function and renew both the access and refresh token. This gives me a new Access token and Refresh token, which expire in 1 hour and 1 week respectively.
However, if I attempt to refresh() the tokens when the Access token is expired, I get the following exception:
Next exception 'RingCentralSDKHttpApiException' with message 'Token not found' in phar:///data/lib/ringcentral-php-master/ringcentral.phar/ringcentral/ringcentral-php/src/Http/Client.php:52 Stack trace: #0 phar:///data/lib/ringcentral-php-master/ringcentral.phar/ringcentral/ringcentral-php/src/Platform/Platform.php(329): RingCentralSDKHttpClient->send(Object(GuzzleHttpPsr7Request)) #1 phar:///data/lib/ringcentral-php-master/ringcentral.phar/ringcentral/ringcentral-php/src/Platform/Platform.php(465): RingCentralSDKPlatformPlatform->sendRequest(Object(GuzzleHttpPsr7Request), Array) #2 phar:///data/lib/ringcentral-php-master/ringcentral.phar/ringcentral/ringcentral-php/src/Platform/Platform.php(252): RingCentralSDKPlatformPlatform->requestToken('/restapi/oauth/...', Array)
I'm not sure why it gives an error saying "Token Not Found", when the refresh token continues to be valid and works for refreshing if the Access Token is valid. Why would I need a valid access token in order to get a new valid access token?
I'm quite confused. Any ideas?