Problems using Twilio in Server Code
Ahh! Makes a lot of sense. Thanks so much, Yurii!
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Ahh! Makes a lot of sense. Thanks so much, Yurii!
Yurii,
The code that you provided works great, but I've been unable to figure out how to add a mediaURL to this method.
I've tried appending your coderequestBody/code, to where it looks like:
pre
var mediaURL = "https://www.google.com/images/nav_logo242.png";
var requestBody = "From=" + encodeURIComponent(myPhoneNumber) + "&To=" + encodeURIComponent(toPhone) + "&Body=" + encodeURIComponent(body) + "&MediaUrl=" + encodeURIComponent(mediaURL);
/pre
This media url works fine when using the Twilio tester interface.
Any advice?
UPDATE: As always, as soon as I post the question and continue to mess around with things, I got it to work...
The mistake I had was using the sendURL:
pre
var sendURL = "https://api.twilio.com/2010-04-01/Accounts/" + accountSid + "/SMS/Messages.json";
/pre
but you have to remove codeSMS//code from the url to become:
pre
var sendURL = "https://api.twilio.com/2010-04-01/Accounts/" + accountSid + "/Messages.json";
/pre
and it works fine.
Hope this helps the next lad...
Thanks!
Hello Jon,
Thank you for the post and for the update.