JavaScript Api Library

A Javascript module for communication with the SenseIoT API.

Architecture

The senseapi.js uses the module pattern to create a SenseApi object that handles communication with the SenseIoT API, much the same way jquery creates a jquery object just by including jquery.js.

  • It stores session information in its internal state.
  • It offers a function call for every API call.
  • It allows access to the raw response status, headers and body received from SenseIoT. As the SenseIoT API uses json as its default data format, converting this to JavaScript objects is trivial.

Getting Started

To get started just:

 src="senseapi.js" type="text/javascript">
 type="text/javascript">
    SenseApi.AuthenticateSessionId();

Further reading

For more information, see the documentation. Also, see the test_senseapi.js file for example code.