Question

SMS API Group?

  • 23 January 2020
  • 2 replies
  • 1529 views

Is the SMS API in the Auth or Medium API Group?

On this site i find:

"RingCentral currently allows you to send a maximum of 40 messages per minute per RingCentral number through our SMS API. If you need to send more than 40 messages per minute, please utilize multiple numbers. For more information, please contact our developer support. "

But while developing my app I was limited to 5 messages. Is this because it is DEV and it will go up in production? Or am i doing something wrong?


Thanks!



2 replies

Userlevel 1

Very likely you login every time you call send an SMS message, and the /auth endpoint has API call limit at 5 calls per 60 secs.

To avoid that, login once then call the SMS endpoint repeatedly. E.g.

var SDK = require('ringcentral')
var rcsdk = new SDK({
      server: RINGCENTRAL_SERVER,
      appKey: RINGCENTRAL_CLIENTID,
      appSecret: RINGCENTRAL_CLIENTSECRET
  });
var platform = rcsdk.platform();
platform.login({
      username: RINGCENTRAL_USERNAME,
      password: RINGCENTRAL_PASSWORD,
      extension: RINGCENTRAL_EXTENSION
      })
      .then(function(resp) {
        for (var i=0; i<40; i++)
          send_sms()
      });

function send_sms(){
    platform.post('/account/~/extension/~/sms', {
             from: {'phoneNumber': RINGCENTRAL_USERNAME},
             to: [{'phoneNumber': "1234567890"}],
             text: 'Hello World from Node JS'
        })
        .then(function (resp) {
          var jsonObj = resp.response().headers
          console.log(jsonObj['_headers']['x-rate-limit-limit'][0])
          console.log(jsonObj['_headers']['x-rate-limit-remaining'][0])
          console.log(resp.text())
          console.log("SMS sent. Message status: " + resp.json().messageStatus)
        })
        .catch(function(e){
          console.log(e.message)
        });
}


More about API Rate Limit

It is not true that if you want to send more than 40 messages, you should use multiple numbers. Read this blog for detailed info.

Hi,

You can send more than 40 messages and it all about how you are sending the messages. Please follow the below link for more details.

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

Reply