Docs icon indicating copy to clipboard operation
Docs copied to clipboard

Is there any improvement in the API docs?

Open rafaalvfe opened this issue 8 years ago • 3 comments

wondering if there will be more documentation for the API anytime soon

rafaalvfe avatar Apr 25 '17 13:04 rafaalvfe

Yes, we are working on Swagger specification. If you need some specific use case that is currently available from the Cloud Console, you can just open the Chrome developer tools to see the REST API commands sent to the server, as the console is a full Restfull client calling the server.

Hope we can get a formal definition of the whole API soon!

alvarolb avatar Apr 25 '17 16:04 alvarolb

when I ask for the device API what does "al" and "fn" mean? what are the possible values? ex. { "light_switch": { "al": 0, "fn": 1 }, "state": { "al": 0, "fn": 3 } }

rafaalvfe avatar Apr 27 '17 13:04 rafaalvfe

Hi, al means "access level", andfn is like "function type". The possible values are inside the thinger_resource.hpp from Arduino library:

    enum io_type {
        none                = 0,
        run                 = 1,
        pson_in             = 2,
        pson_out            = 3,
        pson_in_pson_out    = 4
    };

    enum access_type{
        PRIVATE     = 0,
        PROTECTED   = 1,
        PUBLIC      = 2,
        NONE        = 3
    };

However, access level is not currently being used, as all the methods are private by default. The function type only describes if the resource is an input, output, both input/output/, or just a callback (run). This help to the API explorer and dashboards to know what resources are "usable" for some tasks, like using resources in dashboards.

alvarolb avatar Apr 27 '17 15:04 alvarolb