Open API
Erupt supports external systems obtaining a token via appid + secret to call Erupt endpoints without requiring a user login.
INFO
APPID and Secret are managed in the UPMS → Open API menu, corresponding to the EruptOpenApi entity class. View the Open API Management →
WARNING
At any given time, each APPID can only have one valid token. Calling the token generation endpoint again will immediately invalidate the previous token. For security, call this endpoint from the backend service to avoid exposing the secret to the frontend.
1. Enable Distributed Session
Tokens generated by Open API depend on Redis Session. Enable it in the configuration file:
erupt:
redis-session: true
spring:
redis:
database: 0
timeout: 10000
host: 127.0.0.12. Get a Token
GET {{host}}/erupt-api/open-api/create-token?appid=xxx&secret=xxxResponse example:
{
"token": "xxxxxxx",
"expireTime": "20xx-01-01"
}| Field | Description |
|---|---|
token | Access token for subsequent API calls |
expireTime | Token expiration time |
3. Call Erupt Endpoints
After obtaining the token, include it in the request header to call protected endpoints:
GET {{host}}/erupt-api/your-api
token: xxxxxxxFor information on using endpoint permission annotations, refer to API Development & Operation Logs.
