How to receive webhook signal from 3rd party service - api

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.

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

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.

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.

Related

How to setup a Web Hook API URL with Post Method

UIB Sandbox Access request.
The webhook URL will be receiving a webhook payload as an input.
Get the web hook URL from the application you want to send data
use that URL in webhook section of the application you want to receive data from
choose type of events you want to application to notify you about

SAP Cloud SDK JS receives empty data from Enterprise Messaging Queue

I have build a simple cloud-SDK based application for adding as a Webhook in Enterprise messaging queue to receive the events as soon as it gets inside the queue.
I have an OPTIONS and POST function. OPTIONS is for the handshake with the queue and it works.
Now, when there is message in the Queue, it hits my application with the POST block but the request body is coming as empty object.
I have tried the same from the postman, i'm able to receive the data in request body. Only from the Enterprise messaging queue, the data is empty.
In contrast, to verify this, I have used a Express based nodejs application, there i'm able to receive the data from the queue.
What am i missing in the Cloud-SDK based code ?
POST block, looks like this
#Post('ems-events')
receiveEmsEvents(#Body() requestBody: string, #Req() req:Request) {
Logger.log("Event Received with Data:");
Logger.log(requestBody);
Logger.log(req.body);
Logger.log("Log over--");
Logger.log(Object.keys(req));
return {};
}
The SAP Cloud SDK for JavaScript does not offer any support for Enterprise Messaging as of today. The code you're writing here is most likely Nest.js code, which is an independent framework.
That being said, Nest.js does run Express.js under the hood by default. So if you've been able to make it work in Express, you should be able to make it work in Nest.

Express Session not working with DialogFlow

I have deployed an Express app on Heroku, set my web hook on the address and use my DG agent to make post request to the endpoint on Heroku.
The webhook passes over parameters's body to another web service and that's fine. I need to keep track of the cookie the web service passes back in order to send it back to keep the context of the conversation.
At the moment I am saving a file on the server with the Express's session id (req.session.id) and the cookie value. Everything works if I make POST call via Postman or via form, so let's say the web application is tracking sessions properly.
On the contrary, if I test my webhook with the DialogFlow agent, I receive a new session id per each request to my endpoint on Heroku.
I don't understand why... What am i missing?
I do not believe you can rely on the request from DialogFlow maintaining a cookie for you.
We are using DialogFlow, Google Actions, and Node.js. We retain session information by including data in the response we send back, which we then read when the next request comes in. When writing a response we put our session data (JSON) on the assistant.data attribute. When receiving a request we get session data from the incoming event.body.
We had considered trying to live off a unique ID of the incoming request, such as a user ID or device ID, but did not pursue it.

Server Sent Events using Spring WebFlux, EventSource and RabbitMQ

I want to create live notifications for my website.
Reference link: http://sinhamohit.com/writing/spring-boot-reactive-sse
Above link contains example for SSE and Event Source. The stream of objects is created to create Flux stream.
In my case, I want to create server sent events and send them to RabbitMQ server, the rest controller should be able to listen to message queue and receive the message.
Right now I am able to receive the messages, but I am not sure how I can convert them into Flux and send the stream to rest URL.
How should I do it?
Refernces, links and examples will be great.
Refer following link, here activemq is used but you can also use RabbitMQ.

Want to know little info about enabling Asynchronous Request Processing in Apache Server?

I'm working upon Paypal integration for our website. As we know, we will provide IPN URL for every orders processing through Paypal, Last week, I have given a server URL for the Paypal Notification and also using that, I have processed the payments.
But, today, when i shifted my projects into an another server, where i have implemented the same IPN system. But I dont get the Notification for the same URL, in my new server. It seems that my new apache server doesn't support Asynchronous Request Processing.
What can i do to make my server to process Asynchronous Requests. Anyone please let me know, how can i do it?
Thanks in advance.
The "asynchronous" in the word doesn't refer to a feature that has to be activated in Apache. It's just that PayPal sends the request whenever it's ready, and your script calling it has no way of telling when that is.
Most likely, the server move changed something in the server URL. Try out some of the requests that you are telling PayPal to do manually and see what happens and what errors you get.