Request an access token
Issues an access token for your application with the OAuth 2.0 client_credentials grant.
Request
Send grant_type=client_credentials as application/x-www-form-urlencoded (RFC 6749) or as JSON with the same parameter names. Send each parameter once, in the body, never in the URL query. scope is space-separated and must name only scopes your application is allowed; omit it to receive all of them. See requesting tokens.
Client authentication
Authenticate the client with exactly one of client_secret_basic, client_secret_post or private_key_jwt. With private_key_jwt:
- send
client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer; - sign the assertion with an RS256 or ES256 key registered for the application in the Partner Hub;
- set
iss=sub=client_id, andaud= this endpoint’s URL; - set
expat most five minutes ahead; - use a single-use
jti.
Response
{access_token, token_type: "Bearer", expires_in, scope}, with an evpa_live_… or evpa_test_… token. expires_in is the token’s lifetime in seconds, 900 by default, and scope lists the scopes it carries. There is no refresh token: request a new token when the current one expires. The token answer, like every OAuthTokenError answer, carries Cache-Control: no-store and Pragma: no-cache.
Errors
Errors use the RFC 6749, section 5.2 body (OAuthTokenError), except INVALID_REQUEST, which uses the common Error envelope:
400 INVALID_REQUEST— the body does not ask forgrant_type=client_credentials, for example becausegrant_typeis missing.400 invalid_request— a malformed request: a parameter sent twice, too long or in the URL query, more than one client authentication method,client_secretwithoutclient_id, orclient_assertionwithoutclient_assertion_type.400 unsupported_grant_type— this environment does not offer theclient_credentialsgrant.400 unauthorized_client— the application is not active, or its agency is suspended.400 invalid_scope— a malformed scope, more than 64 scopes, or a scope beyond the application’s allowed scopes.401 invalid_client— any client authentication failure. The answer is the same constant in every case, withWWW-Authenticate: Basicwhen you used HTTP Basic.503 temporarily_unavailable— EVVA cannot answer right now, and no token is issued. Retry afterRetry-After.
Authentication
Client authentication at the token and revocation endpoints with the client id and secret (client_secret_basic, RFC 6749, section 2.3.1). client_secret_post and private_key_jwt send the credentials in the form body instead.
Request
Space-separated; a subset of the application’s allowed scopes.
A JWT signed with RS256 or ES256. Set iss and sub to your client_id, aud to the token URL, and exp at most 5 minutes ahead; jti must be single-use.
Response headers
Response
The access token. The answer carries Cache-Control: no-store and Pragma: no-cache.
The token’s lifetime in seconds. 900 by default; a deployment may set it between 60 and 3600, so read it rather than assume it.
