> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OAuth2 Gateway Authorization Request and Response Example

Here's an example of a gateway adapter authorization request using OAuth2 (client credential flow):

```
POST https://gateway.{root-domain}/token 
-H 'Authorization: Basic Base64(consumer-key:consumer-secret)' 
-H 'Accept: application/json, application/x-www-form-urlencoded'
-H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' 
-H 'Content-Length: [29]'
-H 'X-B3-TraceId:[1hj37d4b54f079d5]'
-H 'X-B3-SpanId: [ic090bikl661dfnb]'
-H 'X-B3-ParentSpanId :[7da09bff5433cac3]',
-H 'X-B3-Sampled:[1]',
-d grant_type=client_credentials&validity_period=100

```

Here's a response example:

```
Response 200 OK: 
{
   "access_token": "d3dad66f-6190-36ae-89d8-2be7e81495ab", 
   "token_type": "Bearer",
   "expires_in": 100
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.