Invalid refresh token / Access token is empty


For the past two days, my refresh token has been rejected as invalid. We refresh it once daily so it should not be expiring.

To remedy this yesterday I used the API Keys page in my account to manually generate new tokens, and have proved that my code was good by manually executing it to refresh the access tokens. But hours later when the code runs again on schedule, I’m getting “Invalid refresh token”.

Any ideas for me?

I’m using python sdk which is POSTing to /oath/v2/token

| | _____ | | | __ _
/ \ \ /\ / / _ \| | |/ _ |
| (
| |\ V V / () | | | (| |
_,| _/_/ _

An official requests based wrapper for the Dwolla API

Support is available on our forums at:

Package – Dwolla/dwolla-python
Author – Dwolla (David Stancu):,
Copyright – Copyright © 2014 Dwolla Inc.
License – MIT
Version – 2.0.4
Link –


Also getting “Access token is empty” when doing

which calls r._get(’/balance’, {‘oauth_token’: alternate_token if alternate_token else c.access_token})


I’ve upgraded to latest version found here:

But now the SDK is breaking on parsing the response.
def _parse()
if r[‘Success’] is not True:

key ‘Success’ is not found

The call itself look liked it worked, but the SDK is just failing to parse the response correctly.


It looks like oauth.refresh() was changed from
return r._post(’/token/’, p, ‘/oauth/v2’, kwargs.pop(‘dwollaparse’, ‘dict’))
return r._post_without_token(’/token/’, p, kwargs, custompostfix=’/oauth/v2’)

since you’re no longer passing ‘dwollaparse’ as ‘dict’, _parse() is incorrectly processing the response as ‘dwolla’


I resolved this by adding

kwargs[‘dwollaparse’] = ‘dict’

just before

return r._post_without_token(’/token/’, p, kwargs, custompostfix=’/oauth/v2’)

in oauth.refresh()


pull request is up… I have no idea what other endpoints may suffer a similar fate.

(Spencer Hunter) #7

Apologies for the inconvenience on this issue, and thanks for the contribution! We merged and updated those changes, but please let us know if you continue to experience issues with the SDK.