Question

RingCentral SMS API Rate Limit and PHP

  • 19 May 2020
  • 1 reply
  • 528 views

Hello,

I am developing a small web app that will allow a small number of administrators to send company-wide SMS messages from our main phone number (I've been told this is a requirement - one number/extension) to employees. We are using this system to send reminders and emergency alerts to up to 250 employees (worst case). On average, these alerts will go to 80-150 people.

I am running into issues working around the API's SMS rate limit using PHP. I was hoping someone could shed some light on the issue and offer suggestions or a workaround. Sending 120 SMS messages would take a total of 3 minutes and PHP will time out after 30 seconds by default. I have tried extended the limits PHP puts in place, but regardless I still run into problems - and this is just not ideal to have a web page spinning for 3+ minutes. I was contemplating offloading the API calls to another server-side language/script instead of using PHP, but I am not sure the best way to go about this.

I have read this article from another forum post, which described a wait period between API calls; however, that still leaves the page spinning and I am not able to use the sleep() function on a Windows server without it counting against the timeout period - linux does not handle sleep() the same.


Any assistance or ideas would be appreciated!


Best regards,

Nick


1 reply

First of all, when it comes to sending SMS messages from an application, please be aware of the A2P SMS regulations and limitations. Read this blog for some guidelines about P2P and A2P SMS

In your case, if you don't exceed or break the FFC regulations (mentioned in the referred blog), then you can use any normal RingCentral phone number and send SMS messages as you have done it. To the problem with the API rate limit, can you make a wait loop on the front end (your web app) and control the speed accordingly? This approach is not a good one but just to work around the problem.

The perfect solution is to use RingCentral Toll-Free SMS number with the A2P SMS API, a new endpoint which can be early accessed upon request (fill out this form if interested). With this new API, 1) it is dedicated for A2P SMS; 2) it can send more than 3 messages per second, and all SMS messages can be sent from a batch (a single API call).

If you have a toll free SMS number, and you want to send SMS ad-hoc, check out if this application can help, instead of implementing your own app. All you need to do is to export recipient numbers to a .CSV file and upload the file when sending messages.

Reply