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

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}}.

Related

Twilio Prevent From Dialing Specific Numbers In Twilio Console

Is there anyway to create a block list in twilio dashboard from dialing or making outbound call.
Since the Developer is control of calling the API, you can place a check before you execute an API call to see if the party is allowed to call a specific number.
Twilio Console does provide Voice Geographic Permissions that allowed you to restrict calling to specific countries.

Triggering a Twilio function to write a record in an external service (e.g. a CRM) whenever an sms message is SENT via Twilio

What the title describes can already be done easily via programs like Zapier, so I am hopeful that it can be done through Twilio functions directly.
Essentially, I have my CRM set up so that based on certain triggers, it sends a http POST request to the Twilio URL that controls SMS sending:
https://api.twilio.com/2010-04-01/Accounts/ + twilioAccSId + /Messages.json
For the most part, this works great!
I just want a way for Twilio to then respond by using a function to write a record into the CRM (using the CRM's APIs).
I would want the record written to include things like the delivery status of the message e.g. whether it failed, or was successful). I'm also open to exploring other ways where Twilio can transmit this outbound message info to the CRM through other means, and then having a function on the CRM then write a record!
Do you have the code to share of what you are attempting and the issue encountered? Or is the question more if this is possible? It is certainly possible.
You will use a statusCallback URL of your outbound POST to the messages resource, which will fire with the statusCallback messages and make an API call to your CRM to update the customer record accordingly. You can append a URL query parameter to your statusCallback, so you know which customer record to update.
Track Delivery Status of Messages
How to Share Information Between Your Applications
Passing Custom Information via Requests to Twilio

Identify forwarded calls

I'm very new at using Twilio. I just created my first flow using Studio, which forwards SMS and calls to my personal phone. Is there a way to differentiate forwarded inbound calls (business) from regular direct calls (personal)?
Thank you!
Twilio developer evangelist here.
I would edit the caller ID in the Connect Call To widget in Studio to be a different validated outgoing number so you know if it is that number, it is for business, as mentioned in this tutorial on call-forwarding with Studio.
You could also trigger the sending of a SMS message from Studio before forwarding the call or SMS message saying that the incoming message/call is for business.
We also offer the Lookup API in your console to find information like location, caller name, and carrier.
Hope this helps!

undefined:undefined Twilio Studio Flow SMS Forwarding Function Error

I've been attempting to create a two-way conversation using SMS forwarding in Twilio Studio flow. I know there are multiple ways to set up SMS forwarding in Twilio, and I have been successful in doing so using functions on their own, TwiML and Studio Flow SMS on the send message widget. However, I am struggling with creating a flow that extends beyond one message. I've added the function for SMS forwarding into my flow, but every time a response is received it displays as "undefined:undefined" as opposed to "+15555555555:Hello SMS", Am i missing something?
You might want to use the CHAT product from Twilio instead which would manage all of the sessions, conversations and everything else.

Twilio Opt-In/Opt-Out API

I am working on an Opt-In /Opt-Out api that integrates with Twilio. The way our Opt-In/Opt-Out works is each company (our customer) signs up for one or more Twilio phone numbers and their customers can opt-in/opt-out into these numbers.
When Twilio receives these opt-in/opt-outs we want Twilio to call us into a webhook URL.
So my question is: how do we register these callback URLs? Do these have to be defined at the time when each company signs up for a phone number? If so whats the API end point for that?
These numbers can be added by different companies at any time. Please advise how to do that. We already have URLs defined for sending and receiving SMS messages with Twilio. In this case we first send the message to Twilio and we specify a callback url in that. Can the Opt-In/Opt-outs work with these already registered end points?
All the phone numbers these companies sing up for are created as a subaccount under us. So is that fine with Twilio and can Twilio call us back on the already registered end points (URLs).
If you have any documentation on how to set up an Opt-In/Opt-Out,please include that. I couldn't find one anywhere. The API method we use for creating subaccounts when companies sign up for a phone number is CreateSubAccount and there is no parameter to specify an call back endpoint URL. I tried contacting their support but they haven't gotten back to us yet.
Twilio developer evangelist here.
I'm not sure exactly what you mean when you say "When Twilio receives these opt-in/opt-outs" as the only thing you will get webhooks for is when a number receives an incoming SMS (or phone call, but we're talking SMS right now).
You can set a different SMS webhook URL per each phone number using the API when you buy the phone number. As part of the POST request to the Incoming Phone Numbers resource you can add the optional parameters SmsUrl and SmsMethod.
Once you have purchased the number, you can also update the webhook URLs for it, by POSTing or PUTing to the instance resource, using the same parameters.
Let me know if this helps at all.

Resources