This is an unfinished wrapper that allows to interact with a Livebox 3 or 4. It is a C# implementation of @rene-d's work on his sysbus script.
Refer to the sample program to see usage examples.
An authentication is done with the Authentication
request.
AuthenticationResponse authentication =
new Authentication(new Credentials("admin", password"))
.PerformRequestAsync()
.Result;
You can check if the request is suscessful with authentication.IsSuccess
. Check authentication.Error
if previous property is false.
If the authentication is successful, the context for your session is automatically saved. If you need it, it's in Settings.Context
. Settings
also contains modifiable data.
You can list all devices that have been once connected to your Livebox by using the Devices
object.
DevicesResponse devices = new Devices()
.PerformRequestAsync()
.Result;
You can check if the request is suscessful the same way you did for the authentication request.
As @rene-d did with his script, you can scrap your Livebox's script file in order to get all callable endpoints.
foreach (WsPath path in WsRequest.GetWsPaths().Result)
// use path.Path and path.Methods
Once you have a path, you can request the API.
WsResponse ws = new WsRequest(
"NMC.Wifi", "set",
new Dictionary<string, string>()
{
{ "Enable", "False" },
{ "Status", "False" }
})
.PerformRequestAsync()
.Result;
MMC.Wifi
is an endpoint (path.Path
) and set
is a method (path.Methods
). The dictionary will be converted into a JSON string in the body of the request (see here).
This call to MMC.Wifi
with those settings will disable your Wi-Fi. In order to find the settings, you'll have to look by yourself to the script.js
file of your Livebox.