APIs allowing you to manage all the gateway functionality are available for everyone.
The documentation of these APIs is on this website: https://api.bbox.fr/doc/apirouter/index.html .
All the APIs using by the management interface are available, you can for example enable or disable the Wi-Fi, manage the Wi-Fi scheduler rules, get the gateway information and even switch on/off the leds.
Some of these APIs are public, and then you can call them without authentication if you are connected to a Bbox. Others are private, and you must be logged to use them.
If you enable the remote access, you can call the APIs without being connected to a gateway, by replacing the domain name mabbox.bytel.fr by the wanIP of the gateway.
In this case, all the APIs are private. 2 or 3 APIs are not available on remote
Below, here's an example of connection and call to one private API, using a shell script:
curl -c /tmp/cookie.jar -XPOST https://mabbox.bytel.fr/api/v1/login -d "password=XXXXXXXXXXXX"
curl -b /tmp/cookie.jar https://mabbox.bytel.fr/api/v1/wireless/scheduler
Result of the wireless API will be:
[
{
"wireless": {
"scheduler": {
"now": "",
"enable": 1,
"status": "NoTime",
"statusuntil": "",
"statusremaining": 0,
"rules": [
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Sunday",
"hour": 0,
"minute": 0
},
"end": {
"day": "Sunday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Sunday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Monday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Monday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Tuesday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Tuesday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Wednesday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Wednesday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Thursday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Thursday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Friday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Friday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Saturday",
"hour": 6,
"minute": 0
}
},
{
"id": -1,
"enable": 1,
"name": null,
"start": {
"day": "Saturday",
"hour": 19,
"minute": 0
},
"end": {
"day": "Saturday",
"hour": 24,
"minute": 0
}
}
]
}
}
}
]
All the responses of the router APIs are JSON.
Another example, using javascript this time:
fetch('https://mabbox.bytel.fr/api/v1/login', {
method: 'POST',
body: "password=XXXXXXXXXX"
})
.then((response)=>console.log(response))
fetch('https://mabbox.bytel.fr/api/v1/wireless', {
method: 'GET'
})
.then((response)=>response.json())
.then((data)=>console.log(data));
Cross domain requests are not allowed for theses APIs, so if you want to use javascript you must use node.js or whithin a browser extension.