How to access webhook events

(Developer Crystal) #1


Can you please explain how to access web hook events ?

Right now we got application access token and create web hook.

Do we need to create web hook for each transfer request or only one time?

Please suggest sample code for retrieving events using web hook.


(Stephen Ausman) #2

Hey Crystal,

Once you create a webhook subscription by making a POST request to /webhook-subscriptions (which it sounds like you already did), webhooks will be sent to the URL you specified without having to create a new subscription each time.

Our webhooks guide has some info on how to handle the webhooks on your end. If you have any questions after reading that, please let us know!

(Developer Crystal) #3


Thank you for your quick response.

Can you please let me know how we get response on specified web hook URL?
Do we need to call Dwolla API again or just get response in POST Method?


(Spencer Hunter) #4

@Developer_Crystal, You’ll simply set up a webhook handler that is tasked with responding to the request from Dwolla and processing the POSTed data sent from Dwolla.


First, write your website and endpoint in the app settings on the dwolla website. (It’s currently under “edit features”).


Make sure that your app listens to port 80 for http or port 443 for https.

Make sure the endpoint does not result in a redirect. For example, a request on my site that looks like this:
redirects to: <-This one should be used for your webhook if you have a similar situation

Here is a sample code in nodejs:

//from the docs…
//this creates the web hook subscription, so that the webhooks get sent to coolEndpoint
//you can use the location to list webhooks (if you have to), among other things
var createWHSubReqBody = {
url: ‘’,
secret: ‘best secret of all time’
.post(‘webhook-subscriptions’, createWHSubReqBody )
.then(res => res.headers.get(‘location’)); // => ‘

//once the subscription is created, dwolla will send webhooks to this endpoint, via post request
//you must respond within 20 seconds with a 2XX status
//for nodejs you must also add bodyparser
//req.headers and req.body should have what you need’/coolEndpoint’, function(req, res) {
//after processing webhook inside req