• Home
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • General
  • News & Announcements
  • Ideas
  • RingCentral Office
    • Getting Started
    • Authentication
    • App Graduation
    • API Betas & Developer Previews
    • REST API
      • Call Management API
      • Glip API
      • Meetings API
      • Messaging API (SMS, Fax, Voicemail)
      • Provisioning API
      • Voice and Telephony API
    • Environment (Sandbox, Gateway)
    • SDKs
    • Admin & Credentials
  • RingCentral Engage
    • Getting Started
    • REST API
      • Interactions API
      • Provisioning API
      • Routing API
  • Jobs/Requests for Help
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Users
  • Badges
Skip to main content
  • Create
    • Ask a question
    • Create an article
    • Post an idea
    • General
    • News & Announcements
    • Ideas
    • RingCentral Office
      • Getting Started
      • Authentication
      • App Graduation
      • API Betas & Developer Previews
      • REST API
        • Call Management API
        • Glip API
        • Meetings API
        • Messaging API (SMS, Fax, Voicemail)
        • Provisioning API
        • Voice and Telephony API
      • Environment (Sandbox, Gateway)
      • SDKs
      • Admin & Credentials
    • RingCentral Engage
      • Getting Started
      • REST API
        • Interactions API
        • Provisioning API
        • Routing API
    • Jobs/Requests for Help
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Sign in
  • Home
  • RingCentral Office
  • Authentication

question

Nigel McLaughlin avatar image
Nigel McLaughlin asked · Dec 02 at 05:06 AM

Authentication Intermittently failing PHP SDK

I have an issue that can be consistently recreated via the PHP SDK.

When trying to authenticate my Sandbox account, 2 out of 3 login attempts will fail with an unrecoverable error.

[02-Dec-2019 15:50:36 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
[02-Dec-2019 15:50:39 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
[02-Dec-2019 15:50:42 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
[02-Dec-2019 15:50:45 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
[02-Dec-2019 15:50:47 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in [no active file]:0
Stack trace:
#0 {main}
  thrown in [no active file] on line 0
[02-Dec-2019 15:50:51 Australia/Melbourne] PHP Fatal error:  Uncaught Exception: Response has unsuccessful status in /vendor/ringcentral/ringcentral-php/src/Http/Client.php:44
Stack trace:
#0 /vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(329): RingCentral\SDK\Http\Client->send(Object(GuzzleHttp\Psr7\Request))
#1 /vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(465): RingCentral\SDK\Platform\Platform->sendRequest(Object(GuzzleHttp\Psr7\Request), Array)
#2 /vendor/ringcentral/ringcentral-php/src/Platform/Platform.php(221): RingCentral\SDK\Platform\Platform->requestToken('/restapi/oauth/...', Array)
#3 /_classes/TelephonyRingCentral.class.php(55): RingCentral\SDK\Platform\Platform->login(Array, '', 'some_password')
#4 /Users/nigelmclaughlin/Documents/WIP/REAS_ in /vendor/ringcentral/ringcentral-php/src/Http/Client.php on line 52

The credentials haven't changed in between. If I try again, sometimes it's successful and sometimes it isn't.

Has anyone else experienced this issue?

apiphpauthenticationphp sdkapi auth
Comment
0
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

4 Answers

· Write an Answer
  • Sort by Created Created
  • Sort by Oldest Oldest
  • Sort by Votes Votes
Khadhar Koneti avatar image
Khadhar Koneti answered · Dec 02 at 06:08 AM

Hi, This is purely serialization issue. Are you using Closure or it is coming PHP SDK ? Please have a look at the below link once.

https://stackoverflow.com/questions/13734224/exception-serialization-of-closure-is-not-allowed

Mean while you can drop an email to ring central dev team. devsupport@ringcentral.com

0 · Share
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

Nigel McLaughlin avatar image
Nigel McLaughlin answered · 6 days ago

After digging into the SDK code it turns out it's returning a 429 error due to rate limiting and throwing an exception due to this.

· 1 comment · Share
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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 ♦♦ · 6 days ago

In that case, read this blog article and change your code to solve your problem.

https://medium.com/ringcentral-developers/ringcentral-api-rate-limit-explained-2280fe53cb16

0 · ·
Phong Vu avatar image
Phong Vu answered · 6 days ago

How to deal with 429 response would be the answer.

0 · Share
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary answered · 22 hours ago

429 is as you discovered a rate limiting issue which actually restrict the API from multiple call for a certain number of time.

There is an official docs available which will help you to understand how this rate limit works and how can you avoid or fix with usage policy :

https://developers.ringcentral.com/guide/basics/rate-limits

0 · Share
1 |1000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

question details

3 People are following this question.

Phong1426275020 follows this question Nigel2780600020 follows this question Dave2526243036 follows this question
Answers Subscribe to Answers Answers and Comments Subscribe to Comments and Answers

Related Questions

PHP - No Token Found error when refreshing Oauth tokens. 4 Answers

staying authenticated on multiple extensions in python to avoid rate limits 2 Answers

Receiving a CMN-211 / HTTP 503 obtaining an OAuth token from DevTest environment 2 Answers

Received "Maintenance Mode" error when trying to authenticate 5 Answers

oauth/token endpoint says my client id is invalid, but it matches exactly what I have in console 5 Answers

  • Developer Home
  • ·
  • Community Guidelines
  • ·
  • Legal
  • ·
  • Privacy Notice