Tommy B.
Tommy B.

Reputation: 3679

How to receive webhook signal from 3rd party service

I'm using a SaaS for my AWS instance monitoring and Mandrill for email sending/campaigns.

I had created a simple chart with Zapier but I'd rather like to host it myself. So my question is:

How can I receive a webhook signal from Mandrill and then send it to Datadog from my server? Then again I guess hosting this script right on the same server I'm monitoring would be a terrible idea...

Basically I don't know how to "receive the webhook" so I can report it back to my Datadog service agent so it gets updated on their website.

I get how to actually report the data to Datadog as explained here http://docs.datadoghq.com/api/ but I just don't have a clue how to host a listener for web hooks?

Programming language isn't important, I don't have a preference for that case.

Upvotes: 3

Views: 3065

Answers (3)

Matt
Matt

Reputation: 584

A "listener" is just any URL that you host where you can receive data that is posted to it. Keep in mind, since you mentioned Zapier, you can set up a trigger that receives the webhook data - in this case the listener URL is provided by Zapier, and you can then send that data into any application (or even post to another webhook). Using Zapier is nice because it doesn't require you to write the listener code that receives the hook data and does something with it.

Upvotes: 0

ahmed.hoban
ahmed.hoban

Reputation: 516

a listener for webhooks is nothing else then a website/app which triggers an action if a request comes in. Usually you keep it secret or secure it with (http basic) authentication. E.g. create a website called http://yourdomain.com/hooklistener.php. You can then call it with HTTP POST or GET and pass some data like hooklistener.php?event=triggerDataDog or with POST and send data along with the body. You then run a script or anything you want to process that event.

Upvotes: 1

gabor.harsanyi
gabor.harsanyi

Reputation: 599

Here you can find how to add a new webhook to your mandrill account: https://mandrillapp.com/api/docs/webhooks.php.html#method=add

tha main thing here is this: $url = 'http://example/webhook-url'; this is your webhook URL what will process the data sent by mandrill and forward the information to Datadog.

and this is a description about what mandrill will send to your webhook URL: http://help.mandrill.com/entries/21738186-Introduction-to-Webhooks

Upvotes: 1

Related Questions