Connect device over Node-Red

Hi everybody,
before i waste a lot of time on a project that will never work, i want to ask the community if this is even possible.
I communicate locally with a device via node-red. I would like to forward the data to thinger.io in order to save it there and display it on the dashboard. Is that generally possible?
I installed the thinger.io nodes, but I can’t get a connection.

Thanks for your support
Ralf

Hi,
I try to do the same thing here.
i tried it with a http node but did not understand if it is possible.

Thank you for your help
Andreas

Hello @easyE4 and @andonoc,

It is possible, in fact there are two different ways to make it depending on the version of thinger.io server that is being used. If you are working with the community server (console.thinger.io) the integration nowadays needs to be made over a data bucket, but this will change when this instance gets updated in 2020 or if a premium instance is being used, in this casse you can use an HTTP device, as it is explained on this part of the documentation: https://docs.thinger.io/devices/http-devices

let me explain how to do this for the old version:
1-Create a data bucket with the name you prefer and “From Write Call” Data source

2-Create an access token with permissions to write over the data bucket

3-Build an HTTP Request using Thinger.io REST API and the token authorization to write the data bucket from a third party software (in this case NoreRED), to know the right API, go to the data bucket interface an open the Network inpector (F12 in Chrome browser):

the REST API we need is:
https://api.thinger.io/v1/users/jt/buckets/NodeRED_Device_Example/data

if we add now the ?authorization= command and the token access, we obtain the complete request that can be used with any POSTMAN service sending a POST request:

https://api.thinger.io/v1/users/jt/buckets/NodeRED_Device_Example/data?authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJOb2RlUkVEX0RldmljZV9FeGFtcGxlIiwidXNyIjoianQifQ.1BOzYXp3UveYxGEmKThrSTIblYgc1Dp3IPBFdGAcu_0

note that the value needs to go in a application/json.

4-in NodeRED create the next flow with an http request node:

image

5-Create a valid JSON in the inject node

6-Copy the REST API and the authorization in the http request node configuration as show below:

7-Then just deploy the flow and check the result in the data bucket inspector:

and we’re done with this! Now it is possible to send JSON with the data you need.
The problem with this integration is that you can’t explode all thigner.io features as can be made using the HTTP device, but you can use the other features calling to the appropriate rest API as we have made in the previous steps.

Hope you find this useful!

Best regards!

Thank you!!!
after finding the right API it works great
Best regards