GadgetKeeper API can be accessed using messaging protocols.
MQTT
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.
Connection
The GadgetKeeper MQTT API accepts the following incoming connections:
Server |
Port |
Comment |
api.gadgetkeeper.com | 1883 | |
api.gadgetkeeper.com | 8883 | SSL-enabled connection, not supported now. |
You can connect to the GadgetKeeper MQTT API for free, without any authentication.
API topic
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:
For example:
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.
Message
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, look at the method-calling message:
And check the response:
Error response examples
From time to time, you can make a mistake with the GadgetKeeper MQTT API. To determine which went wrong, we provide error responses: