Integrations API
Router API Documentation
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_proxy
Method: POST
Description: 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:
type: Proxy type (e.g.,socks5)server: Proxy server addressport: Connection portusername: Login usernamepassword: Login password
Example
curl --location 'http://192.168.5.1:9000/api/update_proxy' \
--header 'Content-Type: application/json' \
--data '{
"192.168.4.253": {
"type": "socks5",
"server": "179.60.183.234",
"port": 50101,
"username": "genrouter",
"password": "MDoFXVw5s8"
},
"192.168.5.104": {
"type": "socks5",
"server": "179.60.183.234",
"port": 50101,
"username": "genrouter",
"password": "MDoFXVw5s8"
}
}'
Sample Response
2. Get Device List
Endpoint: /api/devices
Method: GET
Description: 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/info
Method: GET
Description: 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/info
Method: GET
Description: Retrieves the router configuration, including LAN and wireless settings.
Example
Sample Response
5. Get System Configuration
Endpoint: /api/system/config
Method: GET
Description: 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/network
Method: GET
Description: 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_update
Method: GET
Description: 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_wifi
Method: POST
Description: 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
datathat 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 namepassword: Password (can be set tonullif not used)hidden: Boolean indicating if the SSID is hiddendisabled: Boolean indicating if the SSID is disabledmac,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--insecureflag 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.).
Last updated