I'd like to make an application where the user can enter a phone number and a message and I can have Twilio send that phone number a message with that text synthesized. An example of the TwiML code I'm using is something simple like
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello World</Say>
<Response>
In order to make this work I've tried setting up a PHP function that takes in the message and echoes the above TwiML but the phone calls I get from the test report an application failure. For the record, here's the PHP code I tried.
echo "<?xml version='1.0' encoding='UTF-8'?>";
echo "<Response>";
echo "<Say>" . $_GET['message'] . "</Say>";
echo "</Response>";
However, I was easily able to get a TwiMLBin to work with this (that being its purpose after all). After looking around however I was unable to find anything regarding an API for the site. Does anyone know if there's a way to programmatically create a TwiMLBin so that I can create the appropriate TwiMLBin for the message that my user enters and then direct my Twilio function calls to the appropriate URL?