In my application, I have about 50 users that need to send and receive SMS. How would I integrate this using Twilio? Do I need a number per user so that when they revive an SMS, I can show it to a specific user only?
The link below shows how to receive SMS, but I need help storing/displaying the SMS to the correct user only.
Laravel/Twilio Receiving SMS
Related
I want to copy the behaviour of the Livechat-Popup - Window to send messages from mobile. How would I do that?
Get a Twilio # & Configure
First you need a Twilio subscription. Then purchase a phone number from within your Twilio account. This number will be used to receive SMS messages from other phone and send to LiveChat within Rocket.Chat. Within Twilio, go to your new phone number's settings...
Under 'A Message Comes In' enter this:
https://<your_rocketchat_url>:<your_port_#>/api/v1/livechat/sms-incoming/twilio
That will forward SMS incoming messages to LiveChat.
Tell Rocket.Chat to Listen for SMS's from your Twilio Account
Then, in RocketChat, go to Administration -> SMS, and enter your Twilio Account SID and Auth Token which can be found in your Twilio dashboard and be sure to enable SMS on this page...
Be sure LiveChat is enabled and that you are a LiveChat Agent.
Now, text messages from other phones will appear in LiveChat just like messages from the LiveChat embeded pop-up window. You can respond to those messages within RocketChat as well.
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
Am currently developing a web application using Laravel. I have been using twilio trial account to send messages to just one verified phone number and now I want to launch the application and be able to send sms to any phone number filled on the registration page and send an sms to the user after successfully registration. How do i do this to accomplish my task and move on because I am stack and don't know what to do...
I believe Twilio has a limit on whitelisted numbers during the trial period.
Many SMS Gateway providers do this to prevent spammers.
Nexmo, where I work, has an SMS API allows you to easily send SMS messages to phones in over 200 countries.
The API is extremely reliable, safe, & easy to integrate in your application.
All you need to do is make a simple HTTP call.
After signing up for the free trial, there will be a screen in the dashboard where you are allowed to enter up to 10 whitelisted numbers during the trial phase.
Once you top up (reload your account with funds), this restriction is lifted.
Here is some more information on how to integrate it the SMS API with PHP
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.
I've read auto sms is not possible, if you send a SMS through an app you need user interaction like pressing a button.
But if my phone shows up at a particular position based on gps and a stored record that has that gps info, would that not be the user interaction I need and the sms just get sent?
From the code I've seen if button pressed run this code and send SMS.
What I'd be doing basically is
If I arrive at this location send SMS. From my view this is not exactly Auto SMS, its sms based on certain variables but without user interaction.
Is this possible, am I making any sense lol
As a workaround, you could use one of the SMS services available to send a SMS. If you would like a free solution, you can use the carrier email-sms to send a SMS. You just have to send an email at this point in your code.