Bearer token authentication is the simplest method for API access:
Request Format:
GET /api/v1/recordings HTTP/1.1
Host: api.example.com
Authorization: Bearer your_access_token_here
Content-Type: application/json
Example with cURL:
curl -X GET "https://api.example.com/api/v1/recordings" \
-H "Authorization: Bearer your_access_token_here" \
-H "Content-Type: application/json"
Example with JavaScript:
const response = await fetch('https://api.example.com/api/v1/recordings', {
headers: {
'Authorization': 'Bearer your_access_token_here',
'Content-Type': 'application/json'
}
});
Bearer tokens are obtained through:
![]()
OAuth 2.0 provides secure, standardized authentication for third-party applications:
OAuth Flow:
Authorization URL:
https://api.example.com/oauth/authorize?
client_id=your_client_id&
redirect_uri=your_redirect_uri&
response_type=code&
scope=read write
Token Exchange:
POST /oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&
code=authorization_code&
client_id=your_client_id&
client_secret=your_client_secret&
redirect_uri=your_redirect_uri
Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "def50200abc123..."
}
![]()
Authenticate using API client credentials:
Client Credentials Flow:
POST /oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
client_id=your_client_id&
client_secret=your_client_secret&
scope=read write
Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
Use client credentials flow for server-to-server communication without user interaction.
Manage access tokens effectively:
Refresh Token Example:
POST /oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&
refresh_token=your_refresh_token&
client_id=your_client_id&
client_secret=your_client_secret
Access tokens have expiration times:
Handle token expiration by: