Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zapier: modification of webhook listener HTTP response?

Certain API's require additional information in the webhook listener response. For example, I'm trying to subscribe to Outlook.com's push notification service, which describes the flow below:

"The Outlook notifications service tries to validate the notification URL with the listener service. It includes a validation token in the validation request.

If the listener service successfully validates the URL, it returns a success response within 5 seconds as follows:

Sets the content type in the response header to text\plain. Includes the same validation token in the response body. Returns an HTTP 200 response code. The listener can discard the validation token subsequently."

Zapier responds with the 200 response code, and catches the validation token in the webhook url, but how do I modify the HTTP response to include the validation token in its response to the POST event from Microsoft's notification service?

like image 821
gnyc100 Avatar asked Nov 09 '22 12:11

gnyc100


1 Answers

I don't think you can alter the actual webhook output/response. When testing I always get JSON back - similar to this:

{ "status": "success" "attempt": "578ebd7e-0831-4f9d-a5ef-b6adc72d3ba0" "id": "18a4c58c-3257-4bc9-9bf8-7493d19b0d64" "request_id": "fMBT1iHLOloZYRSM" }

This is even after I set up a custom Zapier app that accepts webhook data (as a custom trigger), and then adjusted the response content and headers using Zapier scripting for catching webhooks:

var Zap = { test_webhook_catch_hook: function(bundle) { bundle.request.content = "custom response"; return bundle.request; } };

The only thing this actually does is change the response that gets sent into the next Zapier action.

like image 199
Matt Avatar answered Dec 04 '22 11:12

Matt