# Getting data from T&D Webstorage

**URL:** <https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901>\
**Category:** General\
**Created:** [2 March 2021 15:08 UTC](https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901 "2021-03-02T15:08:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian.cabrera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sebastian.cabrera](https://discourse.nodered.org/u/sebastian.cabrera)\
**Post date:** [2 March 2021 15:08 UTC](https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901/1 "2021-03-02T15:08:19Z")

</div>

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](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](http://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

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [2 March 2021 15:25 UTC](https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901/2 "2021-03-02T15:25:51Z")

</div>

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

```auto
[{"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.

---

<div class="post-metadata">

**Author:** ![sebastian.cabrera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sebastian.cabrera](https://discourse.nodered.org/u/sebastian.cabrera)\
**Post date:** [2 March 2021 15:44 UTC](https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901/3 "2021-03-02T15:44:41Z")

</div>

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!

 ![2021-03-02 12_43_16-Node-RED](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/3/8387e9dbb5014db38c948527ef4558f01912d819.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 March 2021 15:45 UTC](https://discourse.nodered.org/t/getting-data-from-t-d-webstorage/41901/4 "2021-03-16T15:45:10Z")

</div>

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