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

Register webhook with selected events #44

Closed tjoudeh closed 8 years ago

tjoudeh commented 8 years ago

I'm trying to create my own Rest API for webhooks management by implementing the interface IWebHookStore

My questions is about how we can specify the events that the client are interested in upon registering the webhook. I'm under the impression that each webhook defined should have it's own events related to it.

This how it is done in GitHub; while you are creating the webhook you can select/deselect the events and thats it.

I'm not sure how the method InsertWebHookAsync will be used along with GetFiltersAsync method in this case?

Any hints are really appreciated.

HenrikFrystykNielsen commented 8 years ago

The NuGet package defines two WebAPI controllers which you can use for exactly this purpose. The first [1] exposes a list of filters available for a client to subscribe to. The second [2] provides a registration controller which checks that the registrations have valid filters.

Henrik [1] https://github.com/aspnet/WebHooks/blob/master/src/Microsoft.AspNet.WebHooks.Custom.Api/Controllers/WebHookFiltersController.cs [2]https://github.com/aspnet/WebHooks/blob/master/src/Microsoft.AspNet.WebHooks.Custom.Api/Controllers/WebHookRegistrationsController.cs