Developers can use HTTP(S) API to access and modify resources. It is currently being used by Maker website and mobile applications, and developers are welcome to use it for their own projects.
You can use AllThingsTalk API Postman collection to create IoT device or application which uses our platform services.
Postman is a tool for API testing and development which offers an easy way to create and run API requests.
https://www.getpostman.com/postman
Click on the button below to use the collection and the environment in your Postman setup:
You should see AllThingsTalk API collection in your Collections, and AllThingsTalk API environment selected:
Environment is a set of key-value pairs, which makes multiple API calls easier.
Edit the environment, with your AllThingsTalk Maker username and password:
url:https://api.allthingstalk.io
username:<Your AllThingsTalkMaker username>
password:<Your AllThingsTalkMaker password>
token:
partnerId:
groundId:
deviceId:
assetId:
assetName:
When Get token API request is fired,
token
variable is automatically filled. The rest are up to you, so you can automate your process if needed.
Now you can try to get authentication, create a device, create an asset and publish the asset state.
Run Authentication > Get token call:
This will retrieve your token, and update token
variable in your environment:
Token will be used to authenticate the following API calls.
Sign in to AllThingsTalk Maker with your account. Choose a ground where you want to create a device, and get Ground ID
:
You can use
Ground ID
in the URL enpoint of Create a ground device call directly, or add it as a variable to your environment.
Run the Devices > Create a ground device call:
Back in Maker, you’ll see a new device Weather Station:
Go to Device > Settings > Authentication
and get your Device ID
:
You can use
Device ID
in the URL enpoint of Create a device asset call directly, or add it as a variable to your environment.
Run the Assets > Create a device asset call:
Back in Maker, you’ll see a new asset Outside Temperature:
From Outside Temperature asset details, you can see that the asset Name is temp
.
You can use
assetName
in the URL enpoint of Publish device asset state call directly, or add it as a variable to your environment.
Run Asset state > Publish device asset state call:
Back in Maker, you’ll see asset Outside Temperature state updated:
We work hard on improving our API, so do let us know if you discover anything fishy, or come up with a new API which will help you achieve your idea.