Send SMS with trial twilio account - sms

I want to try to send SMS to a cellphone in Austria. I have set up a free trial Twilio account to do so. however, my Twilio account seems not to be capable of doing so. but I think it should be possible to send SMS with the trial account?
This is a screenshot of my Twilio number where you can see that it's not capable of messaging:
this is the exception i get when running my python-code which tries to send the SMS:
twilio.rest.exceptions.TwilioRestException: HTTP 400 error: 21606: The From phone number +43720881723 is not a valid, SMS-capable inbound phone number or short code for your account.
any idea on how I can get this running? in other words: how can I activate SMS-capability for my free Twilio account? if this is possible, what are the limitations, i.e., how many free SMS messages can I send?
thanks!

To send SMS with trial twilio account TEST ACCOUNT SID and TEST AUTHTOKEN which is placed inside Phone Number > Tools > Test Credentials rather than ACCOUNT SID and AUTHTOKEN given by Console Dashboard > Account Summary.
Because ACCOUNT SID and AUTHTOKEN is bind after you buy the twilio number and TEST ACCOUNT SID and TEST AUTHTOKEN is bind with +15005550006.

If you received this error while trying to authenticate with your Test Credentials, you probably tried to send a message with a From number from your live account. The only number that can be used to send successful messages with your Test Credentials is +15005550006

If you use this number +15005550006 along with your 'demo' twilio sid and token, this will show you the success (no error) but it actually not sending you any sms/ text.
Go to this page https://www.twilio.com/console/sms/getting-started/build and set a phone number like "+133438*****". Twilio will auto provide you a number like (334) 384-**** and by clicking the buttons you need to generate the phone number as like "+133438*****". Once you successful, try to use your 'live' sid and token number within the API. But before integrating the same, you can fire a SMS in your own phone number from this page https://www.twilio.com/console/sms/getting-started/build.
Otherwise, the API error message will show you that - [HTTP 400] *Unable to create record: The 'From' number +1*********** is not a valid phone number, shortcode, or alphanumeric sender ID.

Your number is not capable (configure) for SMS sending. Go to your account and enable SMS capability. After that you will see a green check mark with text
"https://demo.twilio.com/welcome/sms/reply/" instead of Messaging". Similar to below screenshot

I got this error when I was using test Account SID and test Auth Token along with a regular number. Then I changed the Account SID and Auth Token to the regular ones and it worked as expected, i.e. allowed me to send SMS to a verified phone number.

If your number is sms capable and still you are getting the 21606 error, then check 'Active Numbers' tab under 'Manage Numbers'. It should show your number '+43720881723' as an active number.

I had found two errors in this regard, the problem is in the evaluation account and its limitations, but I found a way around it, within the rules of twilio.
Access this page and follow the instructions: https://www.twilio.com/console/sms/get-setup
Write down the number he gives you, this will be your new number, paste it in your application, it will solve your problem, but you still need to do one last thing, you need to check the number you want to send the message to, access this page:
https://www.twilio.com/console/phone-numbers/verified
After you do this, you can try to send the message again, if it fails, the problem must be elsewhere, as it worked for me.

To send SMS with trial Twilio account, test ACCOUNT SID and test AUTHTOKEN which can be found at
Phone Number > Tools > Test Credentials rather than ACCOUNT SID and AUTHTOKEN given by Console Dashboard > Account Summary.

In my case, upgraded my Twilio account and copied the US Florida phone number as it is (9549386330) and got
"is not a valid, SMS-capable inbound phone number or short code for your account"
I only needed to put "1" in front of 19549386330 and it worked.
so check the country code of your phone number as well.

Related

How to load test Sign Up API using Jmeter for 100 users where mobile number & email are unique

I have to perform load test on a Sign UP API using Jmeter.
Sign Up asks for:
valid cell # where system sends SMS code for verfication
Valid Email address where user receives a link for verification
Can any one help for this scenario.
Thanks in advance.
It might be tricky, however you can consider a 3rd-party application like Spikko or 2nr and use mobile automation framework like Appium from JSR223 Test Elements in order to get SMS text from the mobile application. If you don't have a real phone you can use an emulator like Bluestacks or Genymotion
For email it is way easier, JMeter comes with Mail Reader Sampler so you can fetch an email from any real box and extract confirmation URL from there, check out How to Create a JMeter Script to Check Email During Registration AND Grab the Confirmation URL for more details.
You probably should use JDBC Request and get from DB the code/link sent.
But if it's not possible, for email you can concatenate to same gmail +${UUID()}. Gmail at least support sending to same mail if have different suffix:
Here are two different ways you can modify your Gmail address and still get your mail:
Append a plus ("+") sign and any combination of words or numbers after your email address. For example, if your name was hikingfan#gmail.com, you could send mail to hikingfan+friends#gmail.com or hikingfan+mailinglists#gmail.com.

Rocketchat adding a name to incoming Twilio SMS numbers

With Rocket.chat and Twilio - the incoming chat 'user' is just a mobile number. This is not very user friendly if multiple conversations are ongoing. Responding to and tracking conversations by name and not phone number is much better if possible.
I have a database that could be used to match the incoming SMS phone numbers to a human name for most of my expected incoming SMS IM's. Trying to figure out the best way to do a lookup and add that to the Twilio # identity so that the 'chat' makes more sense to the in-house user who would be using it.
Appreciate any ideas anyone might have that would save me from re-inventing the wheel w/ Twilio and Rocket.Chat.
Related to RocketChat: How to send SMS Messages to Livechat channel from mobile
Twilio developer evangelist here.
I have not used RocketChat for this before, I just took a look through the code to see what I could find.
Turns out, RocketChat has a field for phone number on the user model and when an incoming message is received it looks up a user from their phone number. If the user is found, the message is sent from the user, otherwise a new user is created.
So, what you need to do is merge your database of usernames and phone numbers with the RocketChat User model.
Hope that helps!

Pass a unique ID with Twilio HTTP POST

I am currently using Twilio to send balance notifications for customers who have opted into SMS notifications, but have run into an issue in positively identifying accounts in the message logs. A number of customers have multiple accounts due to the nature of my industry, but naturally use the same phone number across all accounts. Is there any way to pass a parameter containing their internal account ID in the HTTP POST request without including it in the message body? I've searched extensively through Twilio's API docs and cannot find this addressed anywhere.
Twilio developer evangelist here.
As far as I know there is currently no way to store metadata, like your account ID, within an SMS sent via Twilio.
One idea could be that you purchase a number of Twilio numbers and tie together a user's phone number, a Twilio phone number and the specific account. That way, if you always send balance notifications for a specific account from a specific number then you can identify that message in the logs as belonging to that user phone number for that account.
Alternatively, I'd have thought it would be useful for users, if they have more than one account, to see to which account you are referring in a balance notification. Would it be possible to include the account id (or some other identifier that the user would recognise) and then parse that out of the message when reconciling messages and accounts?
Not exactly the question but if you are using twilio webhooks for status callbacks you can pass query string params through the status_callback parameter when making the call to send the SMS message and get it sent to your endpoint

Can the SMS forwarding number be removed from the reply using Twilio's to forward SMS messages to another phone number?

I want to use Twilio to create an SMS relaying service where the Twilio number is the only number that is exposed, much like web proxy servers that allow you to access the Internet anonymously. I've used the example php code that twilio provides, saved it to a php file and hosted it on a public web server, then updated the messages URL on the Twilio site accordingly. Any message sent to the Twilio number the is forwarded to my mobile. Everything works fine, except for the fact that when I reply to the forwarded message from my phone, the reply includes a header that says "Sent from your Twilio trial account - + mymobilenumber" I understand that the header is inserted because I have a trial account, however I don't want the mymobilenumber field to be exposed. Is it possible to hide this?
I should mention I'm not really a programmer but I'm learning with Twilio.
I followed the example given here:
https://www.twilio.com/help/faq/sms/how-do-i-forward-my-sms-messages-to-another-phone-number
Thx
Antonio
A short code is a 5 or 6-digit number that can send and receive messages with mobile phones. These high-throughput numbers are perfect for apps that need to send messages to lots of users or need to send time sensitive messages. You can buy shortcodes from Twilio or port existing short codes to our platform.

Twilio SMS verify destination phone numbers and verification ID

I have two questions.
I am creating a website for a client I am trying to code in Twilio SMS tools for end users and for management. I have the request and response tools built so I am all set functionally. So the questions are:
A. Can I send SMS message to any phone number OR does every number I send an SMS have to be added to twilio and verified before I can freely send SMS? It would be nice if I could just collect my phone numbers from the end users and free them from the pain of the verification process.
B. If I must verify end users then can I send SMS messages to them with their verification code? Right now an automated message call is sent to the phone number that wants SMS updates and you have to key in a six digit verification code....AND then you can send that person SMS messages. The phone call is kind of awkward.
A. Once you have a regular Twilio account, you can send an SMS to any phone number. However, some phone numbers (e.g., most landlines) cannot accept an SMS. If you try to send an SMS to those numbers with your cellphone, you will probably get a message back from the carrier that the number cannot accept SMS. However, Twilio will report success in sending the message, even though the message obviously cannot be sent to that number, and you will get no indication that the message did not go through.
But, no, there is no need to specifically add the numbers as verified for them to work with Twilio.
You can use a service like https://www.carrierlookup.com/ (which Twilio told me about) to check if a phone number can receive SMS messages.
B. -- you do not need to verify end users through Twilio, although I do think there are restrictions on a Twilio trial account that will be removed once you have a paid Twilio account.
Twilio evangelist here
Once you upgrade, you can send a message to any phone number. While you are using a trial account, you have to verify a number in order to send a message to it. More info about how a trial account works is here:
http://www.twilio.com/help/faq/twilio-basics/how-does-twilios-free-trial-work
Hope that helps.
Regarding verification: Twilio has a service that allows verifying phone numbers, including format, carrier, if it's mobile or landline, etc: https://www.twilio.com/lookup
API Docs: https://www.twilio.com/docs/lookup/api

Resources