c0D3l0g1c
c0D3l0g1c

Reputation: 3164

Manatee.Trello: Webhook Code Sample

I am looking for a code sample on how to use Manatee.Trello Webhook feature.

I found some documentation here: https://bitbucket.org/gregsdennis/manatee.trello/wiki/Webhooks, but it's not clear enough for me.

It only demonstrates how to create a Webhook, but doesn't demonstrate how the real-time updates are received and processed. Tried the Updated event on the Webhook, Card and Actions - but clearly I am not doing something correctly.

Any help would be appreciated.

Upvotes: 3

Views: 605

Answers (2)

gregsdennis
gregsdennis

Reputation: 8428

You'll need to set up the web portion yourself. This can be done with an ApiController (or others).

Once you receive a POST message, read the content as a string (don't deserialize), and pass that to Webhook.ProcessNotification(). Manatee.Trello well take care of the rest.

This will trigger the Updated events.

EDIT I have created some better docs. Here is the example you seek!

https://gregsdennis.github.io/Manatee.Trello/examples/webhook.html#processing-a-webhook-notification

Upvotes: 2

c0D3l0g1c
c0D3l0g1c

Reputation: 3164

This article demonstrates webhooks in general: https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/

Basically, there is a NuGet package Microsoft.AspNet.WebHooks.Receivers.Trello that you can install that does all the heavy lifting.

Once the NuGet package is installed I can override the built-in Controller and use Webhook.ProcessNotification() as Greg Dennis had suggested.

Hope someone out there finds this useful.

Upvotes: 3

Related Questions