The Authentication API authenticates users to use Lucidworks Platform APIs, including the Lucidworks AI APIs and Commerce Studio Rules and Rewrites API. The single endpoint generates an access token to use in future API requests.Documentation Index
Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
Use this file to discover all available pages before exploring further.
Token guidelines and behavior
- Lucidworks uses OAuth 2.0 to authenticate your credentials.
- Tokens generated by the Authentication API are Java Web tokens (JWT) tokens.
-
Every token generated is active for 3600 seconds before it expires. After that token expires, API requests attempting to use the token fail and generate an HTTP status
401 Unauthorizederror. -
You can generate a new token at any time. To avoid authorization failures, generate a new token before the current token expires. For example, generate a new token five minutes before the current token expires.
To calculate the token expiration time, Base64 decode the JWT and review the
expfield, which contains the expiration time in seconds since the Unix epoch.
Authentication scope
You must specify one or more values for thescope of each authentication request.
The values depend on which API you use:
| Scope | Used For |
|---|---|
machinelearning.model | Models API |
machinelearning.predict | Use Case API, Prediction API, Async Prediction API, and Async Chunking API |
commercestudio.rules | Commerce Studio rule operations (create, read, update, delete rules) |
commercestudio.rewrites | Commerce Studio query rewrite operations (create, read, update, delete rewrites) |
Fetch the access token
Fetch an access token
Fetch an access token
Locate your integration
In the Platform UI, navigate to Models > Integrations and click on your integration.
To fetch an access token, you’ll need these details from your integration:
- Client ID
- Client secret
Compose your request
You’ll send your access token request using the Authentication API.The request uses basic authentication, where your base64-encoded client ID is your username and your base64-encoded client secret is your password.
Some clients perform the encoding automatically; if not, you can use the Compose your request like this:The value of the
base64 command line utility, like this:scope query parameter varies between APIs, and you need a separate access token for each scope:- The Models API uses the
machinelearning.modelscope. - All other APIs use the
machinelearning.predictscope.
Fetch the access token
When you send a successful Authentication API request, the JSON response looks like this:Copy the value of the
access_token key and use it for API authentication.