aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs
Apache License 2.0
627 stars 439 forks source link

Registering against Zapier: The HTTP request echo query parameter was not returned as plain text in the response. Please return the echo parameter to verify that the WebHook is working as expected. #96

Closed alexdresko closed 7 years ago

alexdresko commented 7 years ago

I'm trying to send to Zapier, but when I do something like this https://blogs.msdn.microsoft.com/webdev/2015/09/15/sending-webhooks-with-asp-net-webhooks-preview/ (my implementation isn't quite the same), VerifyWebHookAsync is throwing an exception:

The HTTP request echo query parameter was not returned as plain text in the response. Please return the echo parameter to verify that the WebHook is working as expected.

Is Zapier supposed to understand how to respond to the echo?

Here's the code I'm using to subscribe:

function subscribe() {
    $.ajax({
        type: "POST",
        url: "/api/webhooks/registrations",
        data: JSON.stringify({
            WebHookUri: "https://hooks.zapier.com/hooks/catch/<redacted>",
            Secret: "12345678901234567890123456789012",
            Description: "My first WebHook!"
        }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function(data, status) { alert(status); },
        failure: function(errMsg) { alert(errMsg); }
    });
    return false;
}
HenrikFrystykNielsen commented 7 years ago

Hi Alex,

You can prevent the echo error y including a 'noecho' query parameter, for example

https://hooks.zapier.com/hooks/catch/<redacted>?noecho

The commit 680ebc2f72d52b0bfa587c570dec608fff2a22d8 describes this in more detail.

Hope this helps,

Henrik