EN: 📶 This api is packed full with all functions from administration website from the livebox router, and extract/modify data. This includes WIFI configuration, NAT, softphones, DNS, firewall, etc.
ES: Esta api permite todas las funciones disponibles en la pagina de administración del router livebox y extraer/modificar datos. Esto incluye configuración WIFI, configuración NAT, softphones, dns, firewall, etc.
Before cloning the repo be sure you have installed:
Then:
- Choose a folder project in your system and switch in
cd [folder path]
- Clone the repo in your folder path
git clone https://github.com/EHF32/livebox-api.git
In order to install the project and all dependencies, enter in the project folder and run npm install
npm run start
npm run watch
Go to src/constants/config.js
and change this values to your credentials.
module.exports = {
autologin: true,
user: "admin",
password: "12345678",
url: "http://192.168.1.1",
...
}
It's recommended to enable autologin
, this will login every time you make a request, but if you are going to make a lot of request in short amount of time, instead pass the token manually.
Examples using the API
To login into the router:
// http://localhost:3000/api/v1/login
login().then(token => {
console.log(token);
})
With this you receive a token, that let you use all the others functions. It is not necesary if you have enabled autologin
in src/constants/config.js
.
Example, sending a POST
request to http://localhost:3000/api/v1/wifi_main
with this body params:
{
"wlan_enable1": "0"
}
The 0
means to turn off, and 1
to turn on the wifi.
We can send all the parameters we want to change, for example:
{
"wlan_enable1": "1",
"bss_broadcast1": "1",
"bss_broadcast6": "1"
}
This example will enable wifi, and set wifi to visible.
The list of all parameters is on /parameter list
folder here
You have to send the request to the file of the container of the param, for example if you want to change lan_port1
on nat params, make the request to /api/v1/nat
full list on:
//http://localhost:3000/api/v1/
{
"message": "LiveBox API v1 👋",
"author": "Ángel Herrador",
"entries": {
"wifi_main": "/api/v1/wifi_main",
"phones": "/api/v1/phones",
"softphones": "/api/v1/softphones",
"system": "/api/v1/system",
"lan": "/api/v1/lan",
"status": "/api/v1/status",
"nat": "/api/v1/nat",
"dns": "/api/v1/dns",
"upnp": "/api/v1/upnp",
"ddns": "/api/v1/ddns",
"fw_dmz": "/api/v1/fw_dmz",
"ntp": "/api/v1/ntp",
"firewall": "/api/v1/firewall",
"remote_mgmt": "/api/v1/remote_mgmt",
"infoWifi": "/api/v1/infoWifi",
"infoLan": "/api/v1/infoLan",
"infoSip": "/api/v1/infoSip"
}
}
url | parameter-list |
---|---|
/api/v1/wifi_main |
wifi_main.md |
/api/v1/phones |
phones.md |
/api/v1/softphones |
softphones.md |
/api/v1/system |
system.md |
/api/v1/lan |
lan.md |
/api/v1/status |
status.md |
/api/v1/nat |
nat.md |
/api/v1/dns |
dns.md |
/api/v1/upnp |
upnp.md |
/api/v1/ddns |
ddns.md |
/api/v1/fw_dmz |
fw_dmz.md |
/api/v1/ntp |
ntp.md |
/api/v1/firewall |
firewall.md |
/api/v1/remote_mgmt |
remote_mgmt.md |
/api/v1/infoWifi |
infoWifi.md |
/api/v1/infoLan |
infoLan.md |
/api/v1/infoSip |
infoSip.md |
Following the last example, if we want now to get the value of especific param, we do the same process, but in this case with GET
method.
// BODY GET: http://localhost:3000/api/v1/wifi_main
[
"wlan_enable1",
"bss_broadcast1",
"bss_broadcast6"
]
We get this result:
// RESULT: http://localhost:3000/api/v1/wifi_main
{
"wlan_enable1": "0",
"bss_broadcast1": "1",
"bss_broadcast6": "1"
}
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewFeature
) - Commit your Changes (
git commit -m 'Add some NewFeature'
) - Push to the Branch (
git push origin feature/NewFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Ángel Herrador - GitHub