Docs
Docs copied to clipboard
Is there any improvement in the API docs?
wondering if there will be more documentation for the API anytime soon
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!
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 } }
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.