1

Is it possible to have two webhook url configurations for incoming messages on programmable sms?

I have a messaging service linked to a number. But I also want twilio to send the incoming message as a POST request to another application, which is an inbox application.

Shamaas H.
  • 11
  • 1

1 Answers1

1

You can only have one SMS webhook URL associated with a Twilio number but that URL could point to your logic, which could intelligently forward the requests accordingly.

Another approach which would be simpler would be to add that logic into your Studio flow, right after the Trigger Widget, say using the HTTP Request Widget or Run Function Widget to notify your applications.

Alan

Alan
  • 10,465
  • 2
  • 8
  • 9
  • Thanks Allan, will go ahead with that. I attached the webhook to a script that would do that pointing. Where do i post for a twilio studio bot (not sure what the endpoint for the flow is), and can i just relay it? – Shamaas H. Feb 02 '20 at 18:41
  • You should be able to redirect to the Webhook URL associated with your Studio Flow Trigger Widget. – Alan Feb 02 '20 at 19:55
  • Alan. I really appreciate your help here. Can I call a webhook url from another server (not twilio)? I used the REST Endpoint instead since the webhook url wasn't working. And I expected whenever it is hit for an active user, it would continue the flow. Instead I get an error Received an 'incomingRequest' event while processing the 'opt_in' widget for Execution Sid <> and Flow Sid <> ignoring this event and not transitioning to another widget – Shamaas H. Feb 02 '20 at 22:01
  • You want to ultimately redirect to the Studio webhook (from the Phone numbers webhook which is sending to your application), because the X-Twilio-Signature header is preserved, https://www.twilio.com/docs/usage/security#validating-requests. I know it works with a 302-Redirect, I haven't tried it another way. – Alan Feb 02 '20 at 23:38