How do i know that which IVR key option was pressed by user via Twilio API? - twilio

Hint : As I know that parameter name for IVR option is 'Digit' used in <Gather> which is sent by Twilio $_REQUEST method.
I want to fetch this $_REQUEST['Digits'] value if Twilio maintain this record?.

Twilio will make a request with the 'Digits' parameter to the action URL you specify. If there is no action URL, by default Twilio will POST to the current document. The digits are not stored anywhere on Twilio and not retrievable later.
There's a tutorial on receiving user input from the keypad with Twilio in PHP here.

Related

Twilio Flex Post caller ID's phone number to external webpage

I am setting up a Twilio Flex acct and am wanting when a caller calls and lets say says or presses # 2 I want to ultimately take the callers phone number from the caller id and do a post to an external webpage. I am looking for documentation on this. Anyone have any suggestions?
The Twilio Studio flow I am having issues with it
Twilio developer evangelist here.
By default, incoming calls to a Flex number are directed through a Twilio Studio flow. The default flow passes the caller straight through to get assigned to an agent in Flex, but you can add other widgets to ask for input or direct the call any way you want.
One of the available Studio widgets is the Make HTTP Request widget which allows you to make an HTTP request to a URL of your choice. You can add data to the body of the request using the widget. To get the phone number of the caller you can use the variables set by the inbound trigger. In the case of the phone number of the caller, you need {{trigger.call.From}}.

twilio webhook custom paramters

Is it possible to define custom data in outbound SMS/IVR call and receive same data back on callbackurl/webhook. I want to receive few custom parameters (apart from what twilio sends) when my webhook is called.
Try appending the custom data as URL query parameters to the URL you give Twilio to fetch the TwiML. SMS is a different animal, since it doesn't request TwiML like voice does.
How to Share Information Between Your Applications

HTTP GET request for user's phone number in fulfillment editor

We are setting up a chat bot through Dialogflow. A user will receive a weblink to the bot in a call or SMS sent through twilio. I'm wondering if it is possible for us to set up an HTTP get request to twilio in fulfillment so that we can set a context parameter to the user's phone number in the fulfillment inline editor in Dialogflow.
I took a look at twilio's api docs but could only find information on HTTP requests regarding numbers purchased or available for purchase through twilio.
So to clarify: in Dialogflow's fulfillment inline editor, we want to set a context parameter equal to the user's phone number that twilio called or sent the SMS to with a weblink to our chat bot.
Thanks!
Twilio developer evangelist here.
If I'm understanding right, you want to send a URL to a user via SMS (or over the phone?) which will link them to a web based chat with your bot. And you want to be able to link that chat back to the original phone number?
If that is the case, then the first thing that comes to mind for me would be to create a unique URL for each phone number you send this message to. If you store a link between the URL and the number it is sent to in a database somewhere, then when th euser clicks through to it you can recover the phone number and apply it to your Dialogflow context.
I don't believe you need to make any requests to the Twilio API for this aside from sending the initial SMS.
I hope this helps.

How to configure Twilio send sms with callback url?

We have a requirement to configure callback URL with a custom parameter.
It's possible to configure the callback http url in Twilio console.
But we have to configure the callback url when we send sms so that when the user replies, twilio will make a call to the specified url mentioned.
Is there any way to configure the callback url programmatically?
Your timely help is much appreciated.
Twilio developer evangelist here.
You can't configure the SMS URL to be different based on different users responding to a Twilio number.
You can, however, direct this within your own system. When Twilio makes the webhook to your application it sends through a bunch of parameters including From, the number that sent you the message.
These parameters are sent as URL encoded parameters in the body of the POST request.
In your application you should be able to use that From parameter to look up your user and then deal with the incoming message for that user.
Let me know if that helps at all.

change the voice for twilio number incoming call

We have a twilio number.
When ever any one call on that twilio number then there is an automated voice of twilio play. Can we customize this to a new message?
Thanks,
Rajendra
Twilio developer evangelist here.
You can customise Twilio calls as much as you want! I recommend you take a look through this QuickStart for handling incoming phone calls with Twilio which should get you up and running.
To quickly describe it though, you have a Twilio number and that number has a Voice Request URL configured in the number's settings. When you make a call to that Twilio number, Twilio makes an HTTP request to the URL. That URL needs to return TwiML (a set of instructions to Twilio in XML) which tells Twilio what to do with the call.
If you update the URL to something you control and then return different TwiML, then you can change the message and do a whole lot of other stuff with your Twilio number.

Resources