Getting data from T&D Webstorage

Hi everybody.
I'm just starting with node-red and need to get some temperature data from a T&D Sensor.
It has a web storage service included with the purchase and, to get the data in an automatic way, they offer a webservice on this web page:
https://www.webstorage-service.com/docs/api/reference/devices_device.html

### Request Example

Request Header

POST /v1/devices/current HTTP/1.1
Host: api.webstorage-service.com:443
Content-Type: application/json
X-HTTP-Method-Override: GET

Request Body

[1. If you wish to get device info for all devices.]
*{ *

  • "api-key":"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3",*
  • "login-id":"tbzz9999", *
  • "login-pass":"ppaasswwoorrdd" *
    }

So, i would like to get that data using node-red but i don't know how to combine the information they ask for that.
There is a sample application made in PHP but i can not understand some things...

The data comes in json format, wich is not a problem but the combination of headers and requests is something new for me.

Thanks in advance

Reading info supplied, i think something like this should work, the payload and headers are set in the inject node.

[{"id":"58f449f2.2e4248","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"headers","v":"{\"Content-Type\":\"application/json\",\"X-HTTP-Method-Override\":\"GET\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"api-key\":\"73pfobnche8d1p6laqnemsbnpkght3bjv047oid6p2sg3\",\"login-id\":\"tbzz9999\",\"login-pass\":\"ppaasswwoorrdd\"}","payloadType":"json","x":160,"y":2240,"wires":[["f121dcc0.e3d9f8"]]},{"id":"f121dcc0.e3d9f8","type":"http request","z":"5a245aa1.510164","name":"","method":"POST","ret":"obj","paytoqs":"body","url":"https://api.webstorage-service.com/v1/devices/current","tls":"","persist":false,"proxy":"","authType":"","x":350,"y":2240,"wires":[["e26feb98.54a348"]]},{"id":"e26feb98.54a348","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":2160,"wires":[]}]

I left out port as https should use port 443 by default.

Excellent! With your code i could get all the needed information.
Now it's time to make a pretty dashboard and save that info to a database.

Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.