用服务帐户客户端ID和密钥交换短期不记名令牌。仅支持 grant_type=client_credentials。
application/json
POST /api/v1/oauth/token
cURL (应用程序/json)
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/oauth/token' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"client_id": "string",
"client_secret": "string",
"grant_type": "client_credentials"
}'
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/oauth/token' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'grant_type=client_credentials&client_id=string&client_secret=string'
请求示例
{
"client_id": "string",
"client_secret": "string",
"grant_type": "client_credentials"
}
响应示例 (200)
{
"access_token": "string",
"expires_in": 42,
"token_type": "string"
}
响应示例 (400)
{
"error": "string",
"error_description": "string"
}
响应示例 (401)
{
"error": "string",
"error_description": "string"
}
响应示例 (429)
# Headers
Retry-After: string
# Payload
{
"error": "string",
"error_description": "string"
}
响应示例 (500)
{
"error": "string",
"error_description": "string"
}