I hope this gets a response.
Say Person A sends an SMS to a shortcode in a certain syntax. How could a confirmation SMS be sent to Person A's mobile phone automatically ("Your message has been received successfully!"), after determining that the SMS received from Person A is in the correct syntax? I'm a total newbie when it comes to SMS - so if anyone could describe the entire end-to-end process/architecture that could make this happen, I'd be grateful!
You'd have to find a gateway provider who handles the receiving and the sending of messages for you using a defined API talking to a script/application in the language of your choice.
You usually receive messages on a number defined by the gateway provider. Incoming messages will trigger a call to a URL defined by you. Behind that URL will usually be a script that then performs the desired actions (e.g. parsing the message and sending an automated response SMS through the gateway provider.)
SO questions related to SMS Gateways:
Sending an SMS myself
SMS from web application
BulkSMS provides facilities for you to both send mobile terminating (MT) messages and handle receipt of mobile originating (MO) messages.
You can request a short code, which your users then send MOs to. The message can then be relayed, via a simple HTTP request, to your web server. You application then determines a suitable response and replies via SMS by calling the MT API of BulkSMS.
There may be restrictions and legislation applicable, depending on where you are, where your users are and the networks the messages are passing through. They can provide assistance here too.
International incoming numbers http://www.bulksms.com/int/w/solutions_incoming.htm
Receiving messages via HTTP http://www.bulksms.com/int/docs/eapi/reception/http_push/
Sending API http://www.bulksms.com/int/docs/eapi/
Short codes in South Africa http://bulksms.2way.co.za/w/solutions_psms.htm
Hope this helps
Related
I am writing an app that will facilitate the sending and receiving of SMS messages via a web application. I would like to allow for multiple recipients (not bulk, just a few recipients at most).
I understand that in order to send to multiple recipients, I have to make multiple API calls, and that is fine. The problem I am having is receiving text messages via the Webhook callback. If the SMS was sent to multiple recipients, I cannot see the other recipients in the callback, just myself as the recipient.
Because of this, I have no idea whether this message was intended for just me, or for other recipients as well. This is a problem, because I would like to show threaded conversations similar to Google hangouts, or the SMS applications on all Andorid and iPhones.
I cannot figure out a way to track conversations, if I can't tell if a received message was sent to just me, or a group of recipients. Any suggestions? I do not yes use Twilio on a production server, so if this is not possible to do using Twilio, but is possible using another service, that would be an option for me as well.
Twilio developer evangelist here.
Twilio doesn't fully support group messaging the way that you are used to it when using a phone. That actually relies on MMS under the hood to keep the members of the group chat synced up.
Where you make multiple API calls to send messages to each user, that is manifested as just a single message with no group attached. Thus, any reply to that message comes solely from that person you sent the message to. There is no group at all at this point.
The link that Alex shared in the comments is the closest way you can get group messaging to work. It relies on everyone messaging one Twilio number and the application behind it fanning the messages out to all the recipients. The blog post also comes with some handy subscribe/unsubscribe administration for the group.
Does twilio provide any test mobile numbers for different countries. I want to test whether SMS is sending successfully to some mobile number in Canada.
Is there any test mobile numbers that I can use for this purpose?
Twilio developer evangelist here.
We do not have test numbers available for you to send messages to. However, you can instrument your code such that you can find out from Twilio when you send messages that they are being delivered.
I recommend you set the StatusCallback parameter when you send messages. You set it to a URL on your server that can receive incoming webhooks and it will receive a request each time your message status changes to one of the following: queued, failed, sent, delivered, or undelivered.
That way you can be sure that your messages are sending correctly and arriving at the phones you expect them to.
Let me know if that helps at all.
After I send a sms message to a particular phone number, how do I track the potential conversation?
I see that there is the URL within my Twilio account that Twilio sends http requests to.
Do I just keep checking this URL and go through the messages from the user, using the "from" field in the JSON data?
Twilio developer evangelist here.
When someone responds to your Twilio number then that URL you set in your account will receive a POST or GET request (your choice) with all the details of the message. You don't need to check that URL, the information will come to you.
You could then use the REST API to gather the messages that have gone back and forth between your app by calling for all the messages sent to the user's number and all the messages received from the users number.
You can also, in response to an incoming SMS message, set cookies that can be retrieved as part of the HTTP request. So, if you want to save some data between messages that's a way to achieve that. Here's a guide on using cookies to track SMS conversations.
We have been recently asked to add ability to send and receive MMS to our FLEX application. Our initial plan was to use our existing functionality instead i.e. send an SMS with a subject line. When the client responses to the message with an MMS (because the SMS will become an MMS when the client attaches the required picture) the message will be routed to MMSC who has been requested to forward that message to us an email (because again our application already has ability to receive and process emails built in).
Based on my research I've found that:
1. If you add a subject line to an SMS, the SMS automatically because an MMS meaning we will need to add ability to interact with the MMS gateway. I'm fine with this.
Now my question is, if we send an MMS with a specific subject line, when that the client receives and responds to the MMS, will the subject line be automatically carried back to us like it is done on emails? The information that we will be carrying on that subject line is very important for the correct routing of that reply. Secondly, does anyone know of a website that already has MMS sending functionality. I would like to test this before going further with my design.
I would like to send a text message survey (eg. "How happy were you with X service? Reply 1 for satisified, Reply 2 for not satisfied") to multiple recipients. From the responses, I would like to create a report on the recipients that responded 1 vs the ones that responded 2. What is the best way to do this with the Twilio API? Does my app need to store the results from my incoming SMS message or does Twilio store these so I can query the results? If the former is the case and TwiML is involved, how do I parse the response and store the result? Thanks!
** Disclaimer: Twilio evangelist here **
Chirag:
So it sounds like you have two requirements here:
Use Twilio to send outbound text messages to different recipients
Capture a users reply to that message
For the first requirement, you can start by going to Twilio.com and signing up for a new account. Its free to start and we give you a Twilio phone number you can use to start to build your app. Once you have the Twilio phone number, you can use the REST API to start sending outbound text messages from that Twilio phone number. We have a quickstart that shows you how to do this:
http://www.twilio.com/docs/quickstart/php/sms/sending-via-rest
Note that this link goes to the PHP sample, but you can use the drop down at the top of the page to pick from other stacks like .NET, Java, Python or Ruby.
Once you've sent an outbound message you need to capture the replies to that message (your second requirement). Twilio uses something called a webhook to notify you about incoming SMS messages.
A webhook is basically a URL exposed by your application and associated with your Twilio phone number. You can configure the URL associated with your phone number in the Twilio dashboard.
Each time we receive an incoming SMS message on your Twilio phone number, we will make an HTTP request to that URL. As part of that HTTP request we send along metadata about the inbound message like the phone number that the message was sent from and the Body of the message. The full list of parameters we send is here:
http://www.twilio.com/docs/api/twiml/sms/twilio_request
Now your app can pull those parameters out of the request and do whatever it wants with them. Since we already are sending the body of the message as we receive it, Tims suggestion of tracking the responses based on the From parameter and storing the message body in your own database is a good suggestion.
This quickstart shows receving an incoming text message, grabbing the From parameter and then responding by sending back from TwiML:
http://www.twilio.com/docs/quickstart/php/sms/replying-to-sms-messages
In your case, if you don't want to reply to the incoming message, just omit the TwiML response.
Hope the helps. Lets me know if you need more info.
Devin
Track the responses using the From parameter (and using Body to identify the selection). Yes, Twilio stores those messages, and you could query the API - but it's likely better to just store it in your own database.