The AllThingsTalk API is everything you need to develop IoT device and application clients to use our cloud services. We use the same API in our official web, mobile and device client libraries.
This article explains how to start developing with our APIs and use Maker to manage and test your device clients development.
Devices are special type of client applications with main purpose to measure and feed cloud with real-time sensory data.
After creating a device in Maker, you will get a DEVICE_ID and TOKEN that allows the device client application to feed measured data on it’s behalf into the cloud.
Every time your device client uses this token, the request will be made on behalf of device itself and within it’s authorized scope, so it doesn’t interfere with the rest of your resources. If you try to access user or ground resources using a device token, your request will be blocked.
Add the token to a request authorization header in this form: Authorization: Bearer <TOKEN>
An asset is a generic term that designates a capability of a device or an object observed by devices, e.g. measure temperature, or turn on/off a switch.
A device can have one or more assets.
Asset holds the profile object that describes the state data. It’s purpose is to validate state data incoming from device client and send valid actuation commands as downlink messages.
For the same device, you can add a temperature sensor asset that feeds "type": "number" values:
To delete the temperature sensor:
State is the particular condition that an asset is in at a specific time. Device clients should publish new temperature/state whenever the condition changes. The value should be of the same type that is defined in asset’s profile:
You can also use MQTT protocol to publish sensor (or actuator) state:
Mosquitto is a handy command-line tool to test MQTT. Pick a suitable Binary Installation at Mosquitto download page
You can program your devices to listen for actuator commands by using Messaging Command topics.
Full API Reference is available here