Dwolla API V2 for Webhook


(Tharun Agarwal) #1

I am using Dwolla V2 APIs to integrate a white lablel solution for my client in Sandbox environment. I am successfully able to create a webhook subscription but I am not getting any callback to my callback URL. When I specify the callback url in the Dwolla website which currently allows only V1 APIs, I am getting the callback successfully.

At this moment, I am unable to find out the root cause because I could the webhook created successfully but no event attached to it.

Appreciate your help.


(Stephen Ausman) #2

Hey Tharun,

Does your application (the one you created a webhook subscription for) have an OAuth token for the account you are expecting webhooks for (presumably your client’s account)?


(Tharun Agarwal) #3

Hi Stephen,

Thans for your reply. Yes we have an OAuth token for the account and we are successfully able to create the webhook subscription for the transfer. But the issue is that we are getting the callback after the transfer status has changed.


(Spencer Hunter) #4

@tharun_agarwal, Do you mean you are not getting the callback after the transfer status has changed? To verify webhooks are firing, can you subscribe a http://requestb.in/ url? Once you have a bin url setup to capture webhook requests, initiate a transfer and process that transfer using the Sandbox Console.


(Tharun Agarwal) #5

Hi Spencer, Thanks for your reply. Yes, we have also tried with requestbin url but we didn’t get the callback after the webhook has been created. The same requestbin url worked when we use API V1 for which we need to specify the callback url in the console instead of passing from the create webhook API.

Is there any other way to verify the callbacks?


(Tharun Agarwal) #6

Yes. Sorry My bad. The issue is we are NOT GETTING THE CALLBACK after the webhook subscription has been created for the transfer.


(Spencer Hunter) #7

@tharun_agarwal, This seems to be the same issue @ashwini_s is running into in the thread below.

Can you attempt the steps I outlined in my response to see if the Webhooks are showing up in the listing?


(Tharun Agarwal) #8

Good catch Spencer. Me and Ashwini work together. I am just trying to assist her to get over this quickly. We have deadline approaching and not able to find the root cause yet. As you said, we could see the list of webhooks. I need to check about the list of events.What I could recall is that we are seeing empty array in the attempts object in the json response when we try to get the webhook subscription by passing the id.I will copy the complete response that we are getting soon. One quick qiestion " Do wee need to do anything on the console to enable the webhook subscriptions as we do when using API v1?"


(Spencer Hunter) #9

You do not. Webhooks and webhook-subscriptions for v2 are created and managed entirely through the API. We have considered adding a field in the UI to subscribe a webhook url for v2, however it is not something that is on our short term roadmap.


(Tharun Agarwal) #10

Hi Spencer,

As you said, we verified the list of events by calling the events API and we don’t see any events in the list. I think we are missing something here. For more clear understanding, I am copying the request and response for each action in the webhook flow. Sorry for posting such a long post, but I need help here to figure out the issue.

  1. Request to Get Webhook subscriotion by ID
    https://api-uat.dwolla.com/webhook-subscriptions/74bcb9d9-4252-416a-90fe-c47afc02db52

Accept:application/vnd.dwolla.v1.hal+json
Content-Type:application/json
Authorization:Bearer hFDvcbvLHDy5me1uWNNdsOuM0Jvr3qbdaYq0B36Vh2u1HCKm5f

Response:
{
"_links": {
“self”: {
“href”: “https://api-uat.dwolla.com/webhook-subscriptions/74bcb9d9-4252-416a-90fe-c47afc02db52
},
“webhooks”: {
“href”: “https://api-uat.dwolla.com/webhook-subscriptions/74bcb9d9-4252-416a-90fe-c47afc02db52/webhooks
}
},
“id”: “74bcb9d9-4252-416a-90fe-c47afc02db52”,
“url”: “http://requestb.in/xx3i7uxx”,
“created”: “2016-03-16T10:35:57.000Z”
}

  1. Request to get Events:

https://api-uat.dwolla.com/events

Accept:application/vnd.dwolla.v1.hal+json
Content-Type:application/json
Authorization:Bearer hFDvcbvLHDy5me1uWNNdsOuM0Jvr3qbdaYq0B36Vh2u1HCKm5f

Resposne:

{
"_links": {
“self”: {
“href”: “https://api-uat.dwolla.com/events
},
“first”: {
“href”: “https://api-uat.dwolla.com/events?limit=25&offset=0
},
“last”: {
“href”: “https://api-uat.dwolla.com/events?limit=25&offset=0
}
},
"_embedded": {
“events”: []
},
“total”: 0
}


(Spencer Hunter) #11

@tharun_agarwal, Can you attempt the following: get a new access token for the account that is sending money, reinitiate the transfer, and then check GET /events. I think what may be happening is that the user account access token that is issued to your application is expired.

Also, I attempted to get your list of events with your application access token and it looks like it may be expired as well. Generate a new application access token by POSTing to https://uat.dwolla.com/oauth/v2/token passing in your client_id, client_secret, and client_credentials as the grant_type.


(Ashwini S) #12

Hi spencer,

We tried a lot but not able to fix with web-hook issue,
We are creating new access token for every call, Than also not able to get web-hook event.
Please find attached PDF file. Which contains code for creating web-hook subscription. Please check it and update us if we are doing wrong way.
dwoll-webhook.pdf (48.9 KB)

Where
DwollaUrl=" https://uat.dwolla.com/"
webHookUri = “https://api-uat.dwolla.com/webhook-subscriptions

Thanks,
Ashwini S


(Tharun Agarwal) #13

Hi Spencer,

Will this work without HTTPS in sandbox environment? We are using RequestBin to test our callback flow and I don’t see any HTTPS support in RequestBin.


(Spencer Hunter) #14

@tharun_agarwal, Can you provide the name of the application you are using in UAT and we can take a closer look? Additionally, the account_id of the account that you are triggering these actions on? Feel free to send me a direct message if you want to keep this information private. :slight_smile:

http or https should work as a subscribed webhook url in UAT. However, I do believe we check to see if you have a valid cert.