API Documentation
API Documentation
Overview
This API provides various endpoints for managing clients, installations, devices, and user
authentication. It is built using Node.js, Express, and MySQL, and includes functionalities for user
Setup Instructions
1. Install dependencies:
npm install
DB_HOST=<your-database-host>
DB_USER=<your-database-user>
DB_PASSWORD=<your-database-password>
JWT_SECRET=<your-jwt-secret>
GRAPH_ENDPOINT=<your-graph-endpoint>
node index.js
Endpoints
Authentication
Login
Endpoint: /api/login
Method: POST
Request Body:
"Username": "string",
"Password": "string"
Response:
"accessToken": "string",
"refreshToken": "string"
Refresh Token
Endpoint: /api/refresh
Method: POST
Response:
"accessToken": "string"
Logout
Endpoint: /api/Logout
Method: POST
Client Management
Endpoint: /api/GetClientStatus
Method: GET
Description: Retrieves the status of all clients.
Response:
"Client": "string",
"Connection": "boolean",
"LastHeartbeat": "string",
"ID": "number"
Device Management
Add Device
Endpoint: /api/add/Devices
Method: POST
Request Body:
"Unique_ID": "string",
"Name": "string",
...
Response: Success
Get Devices
Endpoint: /api/GetDevices
Method: POST
"Client": "number",
"Installation": "number"
Response:
"ID": "number",
"Name": "string",
...
Installation Management
Get Installations
Endpoint: /api/GetInstallations
Method: POST
Request Body:
"Client": "number"
Response:
"ID": "number",
"Name": "string",
...
Heartbeat Management
Heartbeat
Endpoint: /api/V2/Heartbeat
Method: POST
Request Body:
"Device_ID": "string"
Response: string