Saltar al contenido principal

Authentication for the use of EMIZOR API service

TL;DR
  • Credentials: You will need a client_id and client_secret provided by Emizor.
  • Validity: The obtained access_token is valid for 1 year.
  • Endpoint: Make a POST request to /oauth/token to begin.

In order to consume any of the services mentioned from this point forward, the authentication process must first be performed in the service as detailed below:

There is a service that allows obtaining the access_token that will allow authentication to use the rest of the API services. The response also sends the validity of the TOKEN, which by default is 1 year.

Since the validity of the access_token is one year, it is only necessary to have a valid token for authentication in the rest of the services.

The obtained access_token can be verified through the JWT decoding service.

The authentication service is accessed with the following link in the documentation:

POST/oauth/tokenLog in to get an authentication token.

The request must include:

{
"grant_type": "client_credentials",
"client_id":"<EMIZOR_PROVIDED>",
"client_secret": "<EMIZOR_PROVIDED>"
}

Where:

  • grant_type: represents the type of credential, always send "client_credentials".
  • client_id, client_secret: represent the two credentials that EMIZOR will provide to the client.

Successful response: code 200

{
"token_type": "string",
"expires_in": 0,
"access_token": "string"
}

Where:

  • token_type: represents the type of token, in this case it is a Bearer.
  • expires_in: represents the duration time, by default 1 year, in Timestamp.
  • access_token: represents the token that will be used for all the remaining services.

Possible error responses:

{
"data": {
"error": "unsupported_grant_type.",
"error_description": "The authorization grant type is not supported by the authorization server.",
"hint": "Check that all required parameters have been provided.",
"message": "The authorization grant type is not supported by the authorization server."
}
}