0

I am using twilio right now by writing a python script and hosting that with ngrok. When I visit the webpage hosted and view the source, I just see TwiML. Is it possible to just write TwiML w/o code?

user3473819
  • 455
  • 1
  • 4
  • 8
  • Do you mean construct TwiML without using a library? If so, then yes. In the response, all Twilio wants to see is a string. However you build that string is up to you. – TwHello Inc Apr 27 '14 at 09:42

1 Answers1

2

Twilio employee here.

Of course you can! If you want to, you can just link the URL to an xml file that you've written and stored on your server - no programmatic generation of the TwiML is required.

One of the simplest ways is to write some plain TwiML on TwiMLbin and just link to the public url for it.

Twilio is just looking for an XML string response to the request it sends - it doesn't care or understand how you generate it.

phalt
  • 1,244
  • 1
  • 10
  • 21
  • Are there any advantages to writing code vs. TwiML? It seems that most of the Twilio tutorials are for code. – user3473819 Apr 27 '14 at 14:14
  • Probably the examples are all code because using Twiml doesn't need much further in the way of explanation. Static twiml files hosted someplace like amazon S3 are perfectly acceptable solution if you don't need a lot of conditional logic to generate the response. – E.J. Brennan Apr 27 '14 at 17:43
  • TwiML limits what you can do, because it is just a set of instructions that Twilio will perform on your behalf. Those instructions are almost entirely telephony-based. If you want to store details, reply with personalised messages or do some complex call-routing based on numbers you'll need to use some code to modify and update the desired TwiML response. – phalt Apr 28 '14 at 10:36