2

I am trying to respond to incoming sms messages with Apps Script through Twilio. I have done all the steps exactly as in the video below. https://youtu.be/j0wjM1Ds3lc

I currently have a doGet function to handle incoming sms messages. In my Twilio number settings under messaging I have set the incoming messages with a GET webhook to the published apps script url.

When I send a sms message to my Twilio number, I can see the message was received in the Twilio logs but nothing happens in the apps script.

The apps script is published as 'anyone even anonymous' can execute. In the apps script logs I can see that the script is not being executed.

I have sms capabilities on Twilio number.

Any help would be greatly appreciated. I apologize if this is something simple I missed.

function doGet(e) {
  var incoming = e.paramater.Body;
  var translated = LanguageApp.translate(incoming, "en", "es")
  var output = ContentService.createTextOutput(translated).setMimeType(ContentService.MimeType.TEXT);
  return output
}

I expect to receive the translated message sent back to my number but currently the apps script is not being executed at all by Twilio.

Marios
  • 26,333
  • 8
  • 32
  • 52
J-rob
  • 21
  • 3
  • 2
    Although I'm not sure whether this is the direct solution, when the script of Web Apps was modified, it is required to be redeployed as new version. By this, the latest script is reflected to the Web Apps. In this case, it supposes that your script is correct. How about this? – Tanaike Sep 03 '19 at 22:34
  • 1
    `The apps script is published as 'anyone even anonymous' can execute.` In addition to what Tanaike said, " Execute" should be set to "Me". – TheMaster Sep 04 '19 at 08:34

1 Answers1

2

Change

var incoming = e.paramater.Body;

to

var incoming = e.parameter.Body;

Also, make sure your Webhook is set to HTTP GET.

enter image description here

NcXNaV
  • 1,657
  • 4
  • 14
  • 23