Hi All,
I'm wondering if anyone else has had this problem... Is there a way to configure a/the response that is sent from Switch back to the webhook originator...? The particular case I'm using this in is with Twilio... I'm generating a text to someone through switch, and they then respond, and that response is sent to a webhook back into switch from Twilio, Twilio is then looking for a response back from Switch after submitting the webhook... I hope this makes sense...
Thanks,
Anthony
Webhook Response
-
- Member
- Posts: 32
- Joined: Fri Mar 24, 2017 7:06 pm
- Location: Cleveland, OH
Re: Webhook Response
Using the constructWebhookResponse entry point in a script should allow for this:
You can change the body of the response from the default '{"status":true}' to what is needed for Twilio. There are a few examples in the Scripting Guide: https://www.enfocus.com/manuals/Develop ... ponse.html
Code: Select all
function constructWebhookResponse( r : WebhookRequest, response : WebhookResponse, args : Array ) : Boolean
{
response.statusCode = 200;
response.write('{status:"true"}');
return false;
}
-
- Member
- Posts: 32
- Joined: Fri Mar 24, 2017 7:06 pm
- Location: Cleveland, OH
Re: Webhook Response
That did it! I was just using the webhook configurator and completely forgot about the ability to script it...
Thank you!
Thank you!