Skip to content

Mideye REST API for User Management Automation

Mideye Server 6 includes a REST API that is disabled by default. While primarily intended for internal development, this API can be enabled to automate various tasks such as exporting accounting data and authentication logs.


Modify the Mideye Server configuration file to enable the API documentation:

OSPath
WindowsC:\Program Files (x86)\Mideye Server 6\config\application-prod.yml
Linux/opt/mideyeserver6/config/application-prod.yml

Add the following lines to the end of the file:

springdoc:
api-docs:
enabled: true

Save the file and restart the Mideye Server service. Then access the Web GUI and log in as root.

Your application-prod.yml file should resemble the following after the changes:

application:
switch-host: host.one.com
switch-backup-host: host.two.com
switch-port: 11111
log-path: C:\Program Files (x86)\Mideye Server 6\log
springdoc:
api-docs:
enabled: true

After logging in, navigate to the following URL:

https://<domain>:<port>/api-docs/

The page displays the available API endpoints:

REST API documentation page


Accessing protected endpoints requires a JWT token. Send an authentication request with your credentials in JSON format:

POST https://localhost:8443/api/authenticate/admin
Content-Type: application/json
{
"username": "your_username",
"password": "your_password"
}

Upon successful authentication, you receive a JWT token. Include it in the Authorization header for subsequent requests:

Authorization: Bearer <your_token>