Obtain a scoped machine token
POST
/v1/integration-oauth/token
const url = 'https://api.academy.example.com/v1/integration-oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({grant_type: 'client_credentials', scope: 'people:write enrollments:write'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.academy.example.com/v1/integration-oauth/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=client_credentials \ --data 'scope=people:write enrollments:write'Versioned integration contract.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
grant_type
required
string
client_id
string format: uuid
client_secret
string
scope
string
Example
grant_type=client_credentials&scope=people%3Awrite+enrollments%3AwriteResponses
Section titled “Responses”Success
Media typeapplication/json
object
access_token
required
string
token_type
required
string
expires_in
required
number
scope
required
string
Example
{ "access_token": "acm_3q2…", "token_type": "Bearer", "expires_in": 900, "scope": "people:write enrollments:write"}default
Section titled “default”Error; error and message identify the reason
Media typeapplication/json
object
error
required
Stable code, e.g. insufficient_scope, not_found, validation_failed
string
message
string
Example generated
{ "error": "example", "message": "example"}