Anonymous Token

Requesting an anonymous token

get

Sends an authentication request and returns an anonymous token. This operation causes creation of a new session-context document.

Anonymous token is valid for one hour. After that time it should be refreshed in order to keep the same session ID associated.

Query parameters
tenantstringRequired

Name of the tenant.

Note: Name of the tenant is always written in lowercase.

Example: {tenant}
client_idstringRequired

Your Emporix API key - client ID.

Example: {client_id}
Responses
200
The request was successful. An anonymous token is returned.
application/json
get
GET /customerlogin/auth/anonymous/login HTTP/1.1
Host: api.emporix.io
Accept: */*
200

The request was successful. An anonymous token is returned.

{
  "token_type": "Bearer",
  "access_token": "tpYgJPZqddEQ2zwfzNtx79noBP65",
  "expires_in": 3599,
  "refresh_token": "7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe",
  "refresh_token_expires_in": 86399,
  "sessionId": "6d4d4d5e-04b9-40c5-9074-4df1405c6081",
  "scope": "tenant={tenant}"
}

Refreshing an anonymous token

get

Sends an authentication request and returns new anonymous token with same session ID attached.

This operation causes update of a session-context document with given session ID.

Anonymous token is valid for one hour. After that time, another refresh anonymous token request should be sent.

Query parameters
tenantstringRequired

Name of the tenant.

Note: Name of the tenant is always written in lowercase.

Example: {tenant}
anonymous_tokenstringRequiredDeprecated

NOTE: It's recommended to use refresh_token parameter instead. Anonymous token that needs to be refreshed so that the same session ID will be kept. Provide the value of the access_token you get in response to requesting a token request.

Example: {GOToGKaEKFyR8DokPBwHH0Y3AKCo}
refresh_tokenstringRequired

A refresh token generated when the anonymous token is created.

Example: {7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe}
client_idstringRequired

Your Emporix API key - client ID.

Example: {client_id}
Responses
200
The request was successful. An anonymous token is returned.
application/json
get
GET /customerlogin/auth/anonymous/refresh HTTP/1.1
Host: api.emporix.io
Accept: */*
200

The request was successful. An anonymous token is returned.

{
  "token_type": "Bearer",
  "access_token": "tpYgJPZqddEQ2zwfzNtx79noBP65",
  "expires_in": 3599,
  "refresh_token": "7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe",
  "refresh_token_expires_in": 86399,
  "sessionId": "6d4d4d5e-04b9-40c5-9074-4df1405c6081",
  "scope": "tenant={tenant}"
}

Was this helpful?