Domanda

Is there any way to perform load testing for sending and receiving an SMS using Twilio API? Can we use twilio magic number for doing any load testing?

È stato utile?

Soluzione

What I have done is -

Sending: use your test credentials to send a message (this won't cost anything and doesn't actually send the message). Since I'm not using short codes (and therefore limited to one sms per second per number), this is more than enough for my scale.

If I wanted to do larger scale testing (sending millions of messages in a very short period of time) I might setup an web endpoint that is Twilio-compatible and then adjust DNS settings to have connections to Twilio.com redirect to that site. This would give me a bit more control over the test environment (and play nicely with Twilio).

Test credentials require "magic" numbers - each of which do something distinct. For example when sending a test SMS message, if you use number "+15005550008" (see the link above), the API will respond with 21611 (SMS message queue full), whereas if you use the number "+15005550006" it will pass all validation and act as though the message were sent. The test credentials link provides a comprehensive list of the various numbers and scenarios supported.

Receiving: I write a simple app that generates test SMS messages (using my test credentials to generate the X-Twilio-Signature HTTP header) and I have it post messages to my test bed at the scale I want to test.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top