Get service account access token
GET
/api/v1/service-accounts/{serviceName}/token
const url = 'https://localhost:8080/api/v1/service-accounts/example/token';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://localhost:8080/api/v1/service-accounts/example/tokenIssue an access token for the named service account, authenticated via the shared API secret
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” serviceName
required
string
Service account name
Responses
Section titled “ Responses ”Token response
Media type application/json
object
access_token
string
token_type
string
Example
{ "token_type": "Bearer"}Service name is required
Media type application/json
object
error
string
error_description
string
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized - Missing, malformed, or invalid API secret
Media type application/json
object
error
string
error_description
string
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Service account is not active
Media type application/json
object
error
string
error_description
string
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Service account not found
Media type application/json
object
error
string
error_description
string
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Internal server error or API secret middleware misconfiguration
Media type application/json
object
error
string
error_description
string
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}