GadgetKeeper API can be accessed using messaging protocols.
The GadgetKeeper MQTT API is a simple way to interact with GadgetKeeper directly from any MQTT enabled client or device. More information about the protocol is at mqtt.org.
The GadgetKeeper MQTT API accepts the following incoming connections:
|api.gadgetkeeper.com||8883||SSL-enabled connection, not supported now.|
Note: API topic is both outcoming and incoming. You can send API request and grab API response from that topic.
It is a good idea to determine format of the topic name. Name must be assembled from an API version, API key and format of a message, like that:
API key grants you specific permissions for thing activities. It is a read, write and publish events actions for all or only one thing, depends on your requests for an API keys. You can create and configure API keys via GadgetKeeper Console.
Format of a message depends on GadgetKeeper API which you want to call, but, generally it based on JSON-RPC 2.0 standard:
For example, the following method message is used to call a thing method:
And a response message follows JSON-RPC 2.0 standard as well
In the example bellow we use Mosquitto MQTT publisher to get thing property value:
And the response: