Voice/SMS testing API or call lists - twilio

I am building an app using Twilio to send out text messages and phone calls. It works great but I know there are limits to the amount of messages to send out per number in any given day. The app is going to be used to send out messages in the thousands at times, for instance to alert contacts about weather cancellations.
Since I am still developing, I do not want to send out real messages to thousands of real numbers a bunch of times while I test and configure my code.
Is there any phone apis, lists, etc. of dummy numbers that can be used as my example contacts that will at least return some form of TRUE that the number exists and received my call/message? Or return something else if I hit a use limit because of the number of messages I am sending.
I think I could get everything setup with a list of 1000 numbers since I can plan out every 250-500 calls, do this or that.

Twilio developer evangelist here.
There are no lists like that that I know of.
You do have a set of test credentials that you can use to send messages to a few "magic" numbers that will behave as if the message was successful (or failed for some reason). However there's only one success message here.
The thing about the limits of 200-250 messages per number per day is that they aren't hard limits. They are just around the level that carriers will start to consider blocking your messages. At that point you will likely still get a positive response from the Twilio API as a message is queued to be sent, but it may or may not fail at delivery time.
I recommend you look into Twilio's messaging services, they allow you to create a number pool that messages are sent from. If you are sending a number of the same messages at the same time, you can also check out Twilio Notify for sending notifications. I recently wrote up a blog post on how to set up a messaging service, number pool and Notify for bulk SMS.
Let me know if that helps at all.

Related

Twilio Response from a non-twilio number

When my friends text my Twilio bot, Twilio responds from another number which is not even Twilio's and is named "SMSInfo". I expect the bot to respond from the same number. I assure you that I haven't set any logic there that a response should come from another number. Also, note that "SMSInfo" is a number which often sends them verification codes for Fiverr or other things.
I just submitted a ticket to Twilio support and a bot automatically suggested me few articles. One of them solved the issue.
Sender ID change may occur when you send messages from a Twilio number
that is not local to your recipients, for example using a US Twilio
number to send SMS to Polish mobile users. This is often done to
comply with local regulations, or to ensure the highest possible
delivery rate for your messages.

Twilio SMS to Multiple Countries

So I'm using Zapier to send text messages to people added to a MailChimp mailing list. A lot of the subscribers are from other countries so I'm just wondering how the interaction works with Twilio.
Will I need a separate number for each country?
Twilio developer evangelist here.
You don't necessarily need another number, Twilio numbers can send internationally (mostly, check the individual settings on the number to be sure, UK landline numbers, for example, can't send internationally).
However, receiving a message from an international number may not be a good experience for your users as they might expect a local number. Good news is that it is easy to build this.
You can create yourself an SMS messaging service. Messaging services are a combination of a number pool along with smart uses of the number pool. You can start your messaging service with one number and add others later. When you add more than one number the messaging service will geomatch between the people you are sending to and the numbers available in the pool, picking the best number for the user.
I'm not entirely sure how this works with Zapier, whether you can set a messaging service ID for your Zap. If that's not possible, you could use Zapier to send a webhook to something like a Twilio Function which you could set up to send the message.
Let me know if that helps at all.

How to limit the amount of messages I can send using Twilio

I'm setting up a chatbot for Whatsapp using Twilio. My question is how can I set a limit on number of messages I can send in a day? It's for my protection, so that if some bug would send over a million messages then Twilio would make me bankrupt.
Heyoooo. 👋 Twilio Developer Evangelist here.
To my knowledge, it's not possible to limit the sent messages on the Twilio side. To set a hard limit you'd have to count and keep track of the sent messages on your end.
There are a few things that you can do that may help already.
Disable auto-recharge
If you're worried about going bankrupt disable auto-recharge for your project. This way you can't just send millions of messages in case your application goes wild.
Set up usage warnings
Additionally, you can set up usage triggers that will send a webhook to a URL you define if your app hits a certain threshold value. This URL could act like kill-switch to really shut everything down after x sent messages.
FYI, Twilio protects you of loops already
To protect your project, messages cannot be sent more than 15 times in a 30 second window between your Twilio phone number and another number. Doing so may trigger a 14107 warning that your message rate has been exceeded.
In case something goes wild Twilio will stop you from sending messages.
I hope that helps. Let me know it goes. :)

Twilio: How to get answers from message log with just phone number

I want to get received messages of the same day of a phone number with the help of API or anything.
(I have purchased ofcourse a phone number)
**
Requirement :
**
I have a twilio app which sends 5 questions to 1000 user and users reply's to it. Like a survey. App is deployed on Azure.
I will get 5000 messages in log.
I am planning to retrieve messages by phone number and update my database from the user.
Implemented :
Implemented this https://www.twilio.com/docs/guides/sms/how-to-receive-and-reply-in-csharp. Any other idea for the requirement is also appreciated.
Twilio developer evangelist here.
I see that you've implemented the basic flow for responding to incoming SMS messages. If you are implementing surveys across a number of users my advice would be to expand on that application.
Firstly, you would need to run through your database to get all your users' phone numbers and send the first question to all of them using the Twilio REST API to send each a text message.
Then, when you receive an incoming message from one of your respondents you can find out the number that sent the message by inspecting the From parameter on the incoming request body. You can then look up your user in your database by phone number and save that response for them. Then you can use the TwiML <Message> to respond to the user and send them the next question.
This way you can collect the responses as they come in, rather than call the REST API to list all responses.
Let me know if that helps at all.

how to associate received sms messages (via twilio) to specific user in my rails app

I'm making an app that sends text messages to a group of people and then people can respond to the text. I want to be able to record the response, know who sent it, and associate it with the user who sent the original message. I've gotten the sending working, and I've begun putting together receiving sms messages but i'm confused. If twilio sends a post request to my server with the from number and message, how will I know which of my users sent the original message?
what if two different users send a message to the same person around the same time? what's the best way to handle this? do I need a separate 'to' number for each of my users? seems like that would get quite expensive. also, if each user has multiple campaigns (messages), how would I associate a response to a specific campaign?
i'm building a rails app.thanks
You'll want to use a different Twilio number for each contact a user sends to. This will establish a unique mapping between the 2 mobile devices and a Twilio number. This allows you to forward incoming messages sent to the Twilio number back to the appropriately mapped mobile phone. You'll do the lookup on your mapping based on who the incoming message is From.
You won't need a Twilio number for every one of your users, but you will need a pool of numbers which is the maximum number of contacts a single person can make.
There is an article on Twilio's site which gives additional information:
https://www.twilio.com/help/faq/sms/how-can-i-have-users-send-text-messages-to-each-other-over-twilio

Resources