Authentication
The API supports API access keys and user tokens. Use the credentials issued for the target environment.
Token Authentication#
Request tokens using a user account.
POST https://api.{ENV}.dais.com/ioi/v3/token
curl --location --request POST 'https://api.{ENV}.dais.com/ioi/v3/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId": "<Username>",
"password": "<Password>",
"grantType": "PASSWORD"
}'
The request requires userId, password, and grantType. Use the returned accessToken and idToken in subsequent requests:
{
"Authorization": "Bearer <Access token>",
"x-jwt-assertion": "<ID token>"
}
API Key Authentication#
API access keys use an API key and secret, managed under Dev Tools > API Access Keys.
Keep the secret on your backend. Load it from an environment variable or key management service rather than exposing it in browser or mobile code.
Send the base64 encoding of Api Key:Secret in the Authorization header:
Authorization: Basic <Base64-encoded API key and secret>
Verify Authentication#
GET https://api.{ENV}.dais.com/ioi/v3/hello
With an API access key:
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/hello' \
--header 'Authorization: Basic <Base64-encoded API key and secret>'
With user tokens:
curl --location --request GET 'https://api.{ENV}.dais.com/ioi/v3/hello' \
--header 'Authorization: Bearer <Access token>' \
--header 'x-jwt-assertion: <ID token>'
A successful request returns the text hello.