This API provides endpoints for developers to interact with and extend the functionality of the router. Below are the main endpoints along with cURL examples, request/response formats, and detailed descriptions.
1. Update Proxy
Endpoint:/api/update_proxyMethod:POSTDescription: Updates the proxy configuration for the specified IP addresses.
Request
Headers:
Content-Type: application/json
Body:
A JSON object where the keys are IP addresses and the values contain the proxy configuration:
Endpoint:/api/devicesMethod:GETDescription: Retrieves a list of devices connected to the router along with details such as IP, MAC, hostname, connection status, and proxy configuration (if applicable).
Example
Sample Response
3. System Information
Endpoint:/api/system/infoMethod:GETDescription: Retrieves system information such as the build version, git commit, last version check time, and whether a reboot is required.
Example
Sample Response
4. Router Information
Endpoint:/api/router/infoMethod:GETDescription: Retrieves the router configuration, including LAN and wireless settings.
Example
Sample Response
5. Get System Configuration
Endpoint:/api/system/configMethod:GETDescription: Retrieves the router's system configuration, including modes such as WebRTC and global proxy settings.
Example
Sample Response
6. Check Network Connection
Endpoint:/api/system/networkMethod:GETDescription: Checks the network connectivity of the router. A response with "success": true indicates that the router is connected to the network.
Example
Sample Response
7. Check for System Update
Endpoint:/api/system/check_for_updateMethod:GETDescription: Checks if a new system update is available and provides details such as the build version, git commit, update ID, and changelog.
Sample Response
8. Create WiFi Network
Endpoint:/api/router/create_wifiMethod:POSTDescription: Creates or configures the WiFi network on the router. The request payload includes radio information and the SSIDs to be configured.
Request
Body:
A JSON object with a key data that contains an array of configuration objects. Each object includes:
id: The radio ID (e.g., radio0)
ssids: An array of SSID configuration objects, each with:
ssid: WiFi network name
password: Password (can be set to null if not used)
hidden: Boolean indicating if the SSID is hidden
disabled: Boolean indicating if the SSID is disabled
mac, brand: Additional fields if applicable
Example
Sample Response
General Notes
Endpoints related to system and router (e.g., /api/system/info, /api/router/info, /api/system/config, /api/system/network, /api/system/check_for_update, /api/router/create_wifi) may require the --insecure flag with cURL if the system is using an invalid SSL certificate.
The examples provided can be adjusted based on your specific environment (IP addresses, ports, authentication details, etc.).