서비스 계정 클라이언트 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"
}