Hi @CLEE, We do have plans to update the existing php swagger client to support making auth related requests to the API. In the meantime, you’ll want to use an external HTTP client for making this specific request. I’d highly recommend taking a look at Guzzle for doing this as it makes it very easy to send HTTP requests. It’ll look something like the following:
<?php
require('autoload.php');
use GuzzleHttp\Client;
$client = new GuzzleHttp\Client(['base_uri' => 'https://api-sandbox.dwolla.com']);
// make a request to the token url
$response = $client->request('POST', '/token', [
'auth' => [
'CLIENTID',
'CLIENTSECRET'
],
'form_params' => [
'grant_type' => 'client_credentials'
]
]);
$responseBody = $response->getBody(true);
$responseArr = json_decode($responseBody, true);
$accessToken = $responseArr['access_token'];
?>