Giter Site home page Giter Site logo

liveboxapi's Introduction

Livebox API

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.

How to use it

Refer to the sample program to see usage examples.

Authenticating

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.

Listing devices

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.

Calling the API

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.