This document describes the User Environment query and switch endpoints. They allow a user to check whether they are currently in the inner or prod environment, and to switch their environment assignment after all services have been stopped.

Authentication

Both endpoints require the user to be logged in.

Request headers:

Header Required Description
Authorization Yes The token obtained after the user logs in.
Content-Type: application/json Required for POST POST request body uses JSON.
LANG or language No Error message language.

Successful response format:

{
  "code": 200,
  "data": {}
}

Error response format:

{
  "code": 10065,
  "msg": "Please stop all running services before switching environments"
}

1. Query the current user environment

POST /user/get_environment

Purpose:

Request parameters: None.

Response fields:

Field Type Description
environment string Current environment. Always inner or prod.

Example response:

{
  "code": 200,
  "data": {
    "environment": "inner"
  }
}

Example:

curl -X POST "<https://tools.greeks.live/api/user/get_environment>" \
  -H "Authorization: <TOKEN>"