The Device API

The Device API may be used by devices to perform all the tasks related to its lifecycle, or those that have to do only with the device itself, like sending an event. All other services related to management of devices, rules or apps, are in the management API.

The purpose of this API is to provide all the services needed to implement a working device able to communicate with Lhings.

It is composed of five web services:

Connecting a device to Lhings using the API will be done in the following steps:

  1. Call Device.register. Store the UUID returned by Lhings, you will need to provide it in any other call to Lhings.
  2. Call Device.setDescriptor with the descriptor of your device as the body of the request.
  3. Call Device.startSession to start communicating with Lhings.
  4. When communication is no longer needed, call Device.endSession to notify Lhings about it.

In the meantime, your device may call Device.sendEvent to notify Lhings about the ocurrence of some events.

Back to top