Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio: Update the Voice (or Message) URL via API?

Tags:

twilio

I've been using Twilio for quite some time, think its a slick service, and would like to use Twilio to power text/voice capability to/from my home automation server (an old mac-mini).

The problem is, if my home IP address changes, then my Twilio number's SMS and Voice URLs would be pointing at the wrong IP, which would obviously prevent my webserver (Node.js) from doing ... well, anything.

My plan was to periodically grab the mac-mini's external IP and update my number's Voice/SMS URLs by POSTing it to the Twilio API, but it doesn't seem that the Twilio API supports this functionality.

Can anyone confirm that it is / is NOT possible to update a number's Voice/SMS URLs via the Twilio API? Otherwise, I'll have to webdrive this ... thank you!

like image 760
Dan Avatar asked Jul 24 '14 03:07

Dan


People also ask

What is Twilio voice API?

The Twilio Programmable Voice API gives developers programmatic control over their calls, with APIs built for a wide variety of uses from basic phone to phone calling, app to phone calling, Interactive Voice Response (IVR), conference calling, SIP interfacing, call recording, transcription, call tracking, and more.

How does Twilio use API?

Twilio's APIs (Application Programming Interfaces) power its platform for communications. Behind these APIs is a software layer connecting and optimizing communications networks around the world to allow your users to call and message anyone, globally. Twilio has a whole host of APIs, from SMS to Voice to Wireless.


1 Answers

Twilio evangelist here.

You absolutely change the Voice and Message Request URLS for your phone numbers via the REST API. Thats basically whats happening when you do it in the portal.

To do it you make a POST request to the IncomingPhoneNumbers instance resource and include the VoiceUrl and SmsUrl parameters. Here is an example.

You can also look at setting the Fallback URL's for you phone numbers as an additional layer of reliability. Fallback URL's let you tell Twilio a second URL to use in case the request to the primary URL fails. You do however have to set fallback URLS via the portal, not the REST API.

like image 82
Devin Rader Avatar answered Oct 06 '22 17:10

Devin Rader