How to send streams with APItester
This tutorial will show how to send data streams to Altair SmartWorks using the free online REST client APItester.com
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:
- Open the web page-> https://apitester.com/
- Select "Request" and add a description (optional) in the first two fields.
- Select "POST" as HTTP verb.
- In the "URL" field type: http://api.altairsmartcore.com/streams/
Type the payload corresponding to your stream in the "Post data" field.
- In the "Headers" section, type "Apikey" and your apikey
- If you want to send stream in XML format, add in the "Headers" section: "content-type" -> application/xml
- Click "Test" 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!