## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://developers.dwolla.com/llms.txt)

Use this file to discover all available pages before exploring further.

POST

https://api.dwolla.comhttps://api-sandbox.dwolla.com

/token

### cURL

```bash
POST https://api-sandbox.dwolla.com/token
Authorization: Basic YkVEMGJMaEFhb0pDamplbmFPVjNwMDZSeE9Eb2pyOUNFUzN1dldXcXUyeE9RYk9GeUE6WEZ0bmJIbXR3dXEwNVI1Yk91WmVOWHlqcW9RelNSc21zUU5qelFOZUFZUlRIbmhHRGw=
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
```

```javascript
// 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));
  });
```

```python
# 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
<?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;
?>
```

```ruby
# 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="...">
```

### Response Codes

- **200** - Successful operation
- **401** - Invalid client

### Example Responses
```json
{
  "access_token": "gTm0p62yYXFiB1rOdhV0TsNOinC2V2P1CMaAtojkO9JEGbv3i5",
  "token_type": "Bearer",
  "expires_in": 3599
}
```
```json
{
  "error": "invalid_client"
}
```

#### Body

application/x-www-form-urlencoded

**OAuth get token request.** Client credentials are sent in the Authorization header using Basic authentication.

**grant_type**  
enum<string> required  
Must be set to "client_credentials"  
Available options:  
`client_credentials`  
Example:  
`"client_credentials"`

#### Response Fields
- **access_token**: string, required, A new access token that is used to authenticate against resources that belong to the app itself. Example: `"gTm0p62yYXFiB1rOdhV0TsNOinC2V2P1CMaAtojkO9JEGbv3i5"`
- **token_type**: string, required, The type of token, always "Bearer". Example: `"Bearer"`
- **expires_in**: integer, required, The lifetime of the access token, in seconds. Default is 3600. Example: `3599`
