Create an application access token
Generate an application access token using OAuth 2.0 client credentials flow for server-to-server authentication. Requires client ID and secret sent via Basic authentication header with grant_type=client_credentials in the request body. Returns a bearer access token with expiration time for authenticating API requests scoped to your application. Essential for secure API access.
POST https://api-sandbox.dwolla.com/token
Authorization: Basic YkVEMGJMaEFhb0pDamplbmFPVjNwMDZSeE9Eb2pyOUNFUzN1dldXcXUyeE9RYk9GeUE6WEZ0bmJIbXR3dXEwNVI1Yk91WmVOWHlqcW9RelNSc21zUU5qelFOZUFZUlRIbmhHRGw=
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials// Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-node
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
client.auth
.client()
.then(function (appToken) {
return appToken.get("/");
})
.then(function (res) {
console.log(JSON.stringify(res.body));
});
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
app_token = client.Auth.client()
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
// This example assumes you've already intialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
$tokensApi = new DwollaSwagger\TokensApi($apiClient);
$appToken = $tokensApi->token();
DwollaSwagger\Configuration::$access_token = $appToken->access_token;
?>
# Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-ruby
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
app_token = $dwolla.auths.client
# => #<DwollaV2::Token client=#<DwollaV2::Client id="..." secret="..." environment=:sandbox> access_token="..." expires_in=3600 scope="...">
{
"access_token": "gTm0p62yYXFiB1rOdhV0TsNOinC2V2P1CMaAtojkO9JEGbv3i5",
"token_type": "Bearer",
"expires_in": 3599
}{
"error": "invalid_client"
}Body
OAuth get token request. Client credentials are sent in the Authorization header using Basic authentication.
Must be set to "client_credentials"
client_credentials "client_credentials"
Response
successful operation
A new access token that is used to authenticate against resources that belong to the app itself.
"gTm0p62yYXFiB1rOdhV0TsNOinC2V2P1CMaAtojkO9JEGbv3i5"
The type of token, always "Bearer"
"Bearer"
The lifetime of the access token, in seconds. Default is 3600.
3599
Was this page helpful?
POST https://api-sandbox.dwolla.com/token
Authorization: Basic YkVEMGJMaEFhb0pDamplbmFPVjNwMDZSeE9Eb2pyOUNFUzN1dldXcXUyeE9RYk9GeUE6WEZ0bmJIbXR3dXEwNVI1Yk91WmVOWHlqcW9RelNSc21zUU5qelFOZUFZUlRIbmhHRGw=
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials// Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-node
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
client.auth
.client()
.then(function (appToken) {
return appToken.get("/");
})
.then(function (res) {
console.log(JSON.stringify(res.body));
});
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
app_token = client.Auth.client()
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
// This example assumes you've already intialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
$tokensApi = new DwollaSwagger\TokensApi($apiClient);
$appToken = $tokensApi->token();
DwollaSwagger\Configuration::$access_token = $appToken->access_token;
?>
# Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-ruby
// This example assumes you've already initialized the client. Reference the SDKs page for more information: https://developers.dwolla.com/sdks-tools
app_token = $dwolla.auths.client
# => #<DwollaV2::Token client=#<DwollaV2::Client id="..." secret="..." environment=:sandbox> access_token="..." expires_in=3600 scope="...">
{
"access_token": "gTm0p62yYXFiB1rOdhV0TsNOinC2V2P1CMaAtojkO9JEGbv3i5",
"token_type": "Bearer",
"expires_in": 3599
}{
"error": "invalid_client"
}