The API provides a RESTful interface to access device data.  Data is available immediately after it is presented by a device, however using a RESTful API requires regular polling the API for data, which is inefficient and subject to latency.

A better way to access live data is to connect to one of our WebSocket live data servers.  Live data is presented in exactly the same format as any other data request from the Igtimi API.

Igtimi may provide more than one different WebSocket servers at any time.  Use the SERVER_LISTERS API call to determine which server(s) are available to connect to. Here’s the cURL example…

$curl --insecure

Best practice is to always grab this server list, and then try connect in order from the top to the bottom until you get a successful connection. In some situations firewalls or non-web-socket compliant proxies may block one or more of these services and so it’s important to have this logic in your code when you deploy it.

Once you have connected to the WebSocket you will need to send a request to the open web socket with an access token and devices serial number to start receiving data.

You should then receive messages for devices you have subscribed to;. 

Below is an example in javascript... = new WebSocket(url); = _.bind(function(ev) {doSomethingWithEvent(ev)});{ "access_token": this.auth_token, "devices": this.units }));

For more information on how to communicate with a WebSocket server, please observe the behaviour of in a web browsers developer tools, or contact