How to send streams with Poster
This tutorial will show how to send data streams to Altair SmartWorks with Poster.
First, we need to know what we want to send and how to send it. Data is sent to Altair SmartWorks REST API. You need:
- A device in Altair SmartWorks
- A valid Apikey
- Your data
- A REST client
If youre registered in Altair SmartWorks, you have a default device already created for you.
Check your control panel and see what it looks like.
Basically you need the device id_developer that might be something like defaultDevice@myusername.
We will assume we have the test@smartcore device for this tutorial.
Now, go to your control panel “My account menu” and check your Apikey.
Its a big alphanumeric token like 98346673a6377ef1fde2357ebdcb0da582b150b00cabcd5a0d83045425407ab4.
Now we define our data. It will be a simple data set with temperature and humidity:
Finally we need a REST client. This client can be whatever you want that can create full HTTP request including headers, verbs and so on.
Follow these steps:
- Install Poster for Firefox https://addons.mozilla.org/en-us/firefox/addon/poster/
- Once installed, open it (Ctrl+Alt+P)
- In the "Content Type" section, type -> application/json or application/xml
- In the "URL" section, type -> http://api.altairsmartcore.com/streams/
Click the "Content to Send" tab and type your payload.
- Click the "headers" tab and type your apikey
- Click post button
You should have something like this:
Now you can see your stream listed in the control panel stream list. Go to “Data management” → “Data streams” and you will see your data.
Its easy, isnt it?. Enjoy Altair SmartWorks!