question

Ian Middelkamp avatar image
Ian Middelkamp asked Phong Vu answered

Testing Rate Limits

I am having trouble developing with rate limits in mind. Is there a way to simulate the rate limits being exceeded for sending sms and getting messages?

sms and text messaging
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered

It's very easy to exceed the rate limit. There is no way to simulate it but as you wish, just put the API call function in a loop and call more times than the rate.

This is a simply example using Node JS

for (var i=0; i<60; i++) {
    await send_sms()
}

async function send_sms(){
  try{
    var resp = await platform.post('/restapi/v1.0/account/~/extension/~/sms', {
             from: {phoneNumber: "fromNumber"},
             to: [{phoneNumber: "toNumber"}],
             text: "Hello from Node JS",
        })
    var jsonObj = await resp.json()
    console.log("SMS sent. Message status: " + jsonObj.messageStatus, jsonObj.id)
    var obj = resp.headers
    console.log(obj)
  }catch(e){
    console.log(await e.response.json())
  }
}

Please read this article to learn more about how to deal with API rate limit.

1 |3000

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

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys