Skip to main content

Authentication

All Xemelgo GraphQL and REST APIs are authenticated. Before calling any API, obtain an IdToken from the Login REST API and send it as the Authorization header on every request.

Login API​

Endpoint Details​

  • URL: https://rest.api.xemelgo.com/login
  • Method: POST

Properties​

PropertyTypeDescriptionRequired
emailStringbase64 encoded email for userYes
passwordStringbase64 encoded password for userYes

Password needs to be a minimum of 8 characters and should contain a number.

Request Body​

{
"email": "base64_encoded_email",
"password": "base64_encoded_password"
}

StatusCode — 200 on success

Response Body​

{
"AccessToken": "$accessToken",
"ExpiresIn": 480,
"TokenType": "Bearer",
"RefreshToken": "$refreshToken",
"IdToken": "$idToken"
}

Use the $idToken as the Authorization header for all subsequent API requests:

Authorization: $idToken

Errors​

ErrorError codeException
Incorrect username and/or password400NotAuthorizedException

For authorization errors returned by the GraphQL APIs (expired/invalid/missing token), see Errors.