Cannot get token anymore

I had successfully integrated dwolla into my application. Now I am getting a 401 error connecting to the API. I have always used the following code to generate a token and never had an issue

$client_id = $key;
$client_secret = $secret;
$basic_credentials = base64_encode($client_id.':'.$client_secret);
$ch = curl_init('');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.$basic_credentials, 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'));
curl_setopt($ch, CURLOPT_POSTFIELDS, 'grant_type=client_credentials');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch));
$token = $data->access_token;


Has something changed on Dwolla’s side?

Hi @mjf017 – thanks for posting!

Not a recent change, but we’ve changed the token URL as well as the manner in which an application’s client credentials are sent to Dwolla to be inline with OAuth spec.

The new Dwolla token exchange endpoints are as follows,

You can find more information in our Changelog as well as the API reference documentation. Let me know if you have any questions!