Twilio SMS API use

Hello,
I try to use Twilio Api to send sms.
I convert the desktop xojo example to a web app found there
https://blog.xojo.com/2017/07/17/quick-tip-sending-text-messages-using-twilio/

I see that the APi that is used have arelaese date back to2010.
I try to use it with real number and get this error

"{“code”: 21606, “message”: “The From phone number +3069mymobulenumber is not a valid, SMS-capable inbound phone number or short code for your account.”

Is there any more recent project that it might works or any newer xojo web examples or can anybody suggest modifications I can do in order to make it work?

I found some in this forum but most projects does not exist anymore (the link is dead)
Thank you in advance
MB

I just used the example that is included with Xojo to send an SMS from Twilio:

Examples/Communication/Internet/TwilioSMS

I did have to go to my Twitter account and request a new Twilio phone number to use as the From phone number in the example app. I also had to make sure I used the ACCOUNT SID and AUTH TOKEN shown on the Dashboard and not the ones show on Settings. I don’t know why there are different auth tokens and I could not get the test ACCOUNT SID to work.

Thanks Paul,
So maybe i dud something wrong in setting up my Twilio account.
I just opened an account and then i got a verification message to my phone.
Do i have to declare in twilio my mobile number?

Yes, your mobile number does need to be verified before you can send to it.

https://www.twilio.com/console/phone-numbers/verified

yes it is there in the “verified callers id” list.
So, is there anything else i may missed?

I can’t say. I went through the “curl” tutorial and it prompted me for the stuff I didn’t have set up correctly. Once I could send an SMS with curl, I knew which values to use in the Xojo example and everything worked.

Since it sounds like a policy problem with Twilio, you’d probably get more useful support from them, not us. You got a response which means the Xojo code is working.

1 Like

@Michael Batakis : Here’s a Xojo console app that includes a very basic example of how to send an SMS via Twilio:

https://s3.amazonaws.com/aloe-zone/downloads/twilio.xojo_binary_project.zip

In the app.run event handler, set your Account SID, Auth Token, as well as the “From” and “To” phone numbers. Then run the app, and the SMS should be sent. If not, then look at the Response property of the Twilio class instance for info on what went wrong.

Good luck!

Thank you all of you,
I used a chilkat rest library and get the same results… so it might be a twilio policy regarding my country. I need to change country :slight_smile:

FYI: An alternative api solution for sending sms comes from gatewayapi.com -
sample projects for web and desktop here:
https://forum.xojo.com/52638-sms-rest-api-python-xojo-cloud/p1#p426505