# 'GET' "decoded\_payload" from uplink\_message out of Storage-Integration http-Reuqest

**URL:** <https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787>\
**Category:** The Things Stack v3\
**Created:** [February 4, 2021, 9:37pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787 "2021-02-04T21:37:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![symlink](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/symlink/32/35697_2.png) [@symlink](https://www.thethingsnetwork.org/forum/u/symlink)\
**Post date:** [February 4, 2021, 9:37pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/1 "2021-02-04T21:37:30Z")

</div>

Hi Community,

i’ve four sensors running in TTSv3 and Storage-Integration activated.

When i request the uplink\_message for my app there is so much unnecessary data.  
I just want to get the “decoded\_payload” out of “uplink\_message”.  
Is there a way i’am missing so far?

Thanks for your time _cheers_

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [February 4, 2021, 9:40pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/2 "2021-02-04T21:40:50Z")

</div>

You really should take the rest of the information too.

Otherwise you have no real way of knowing things like how old the packet is.

In particular, you should _not_ be inserting timestamps or sequence numbers inside of packet bodies - because that information is already available in metadata, inserting it in the packet itself would be wasteful duplication

---

<div class="post-metadata">

**Author:** ![symlink](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/symlink/32/35697_2.png) [@symlink](https://www.thethingsnetwork.org/forum/u/symlink)\
**Post date:** [February 4, 2021, 9:57pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/3 "2021-02-04T21:57:41Z")

</div>

Hi,

thank you very much for your reply! So, i’ll keep the data and parse the “for me useful” parts out of it to lower the resulting filesize.

greetings and cheers

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [February 4, 2021, 10:26pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/4 "2021-02-04T22:26:21Z")

</div>

> [@symlink](#):
>
> i’ll keep the data and parse the “for me useful” parts out of it to lower the resulting filesize.

Hard disk is cheap, getting data you realise would have been useful after the fact is hard - I’d save the whole message, perhaps compacted or compressed just in case in a few weeks time you realise that something you didn’t think was useful, is.

---

<div class="post-metadata">

**Author:** ![htdvisser](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/htdvisser/32/45312_2.png) [@htdvisser](https://www.thethingsnetwork.org/forum/u/htdvisser)\
**Post date:** [February 5, 2021, 8:38am UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/5 "2021-02-05T08:38:55Z")

</div>

If you really know that you’ll only ever need a specific set of fields, you can tell the server to only send you those fields.

> **Note:** This is new functionality in The Things Stack v3.11.

With the CLI that would look like this:

```bash
$ ttn-lw-cli applications storage get your-application-id \
  --type uplink_message \ # only select uplink messages
  --after-utc "2021-02-05 00:00:00" \
  --before-utc "2021-02-05 08:00:00" \
  --end-device-ids \ # you probably want device IDs
  --received-at \ # you want to know when it was received
  --up.uplink-message.f-port \ # you want the FPort
  --up.uplink-message.frm-payload \ # maybe the raw payload
  --up.uplink-message.decoded-payload # and otherwise the decoded payload

```

You can run `ttn-lw-cli applications storage get --help` to see the full list of command-line flags you can use to filter data from the storage integration.

On the HTTP API it works in a similar way:

```bash
$ curl -G "https://eu1.cloud.thethings.network/api/v3/as/applications/your-application-id/packages/storage/uplink_message" \
  -H "Accept: text/event-stream" \
  -H "Authorization: Bearer $API_KEY" \
  -d "after=2021-02-05T00:00:00Z" \
  -d "before=2021-02-05T08:00:00Z" \
  -d "field_mask=end_device_ids,received_at,up.uplink_message.f_port,up.uplink_message.frm_payload,up.uplink_message.decoded_payload"

```

---

<div class="post-metadata">

**Author:** ![NordBase](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/nordbase/32/35697_2.png) [@NordBase](https://www.thethingsnetwork.org/forum/u/NordBase)\
**Post date:** [February 25, 2021, 7:02pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/6 "2021-02-25T19:02:58Z")

</div>

Hello

I tried use http request from node red but without success.  
Using query from web browser as test everything is working perfect.  
Can you suggest how I should setup right http request flow in node red to get storage data form Stack v3?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [February 25, 2021, 8:04pm UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/7 "2021-02-25T20:04:52Z")

</div>

How did you get it working in a browser - it needs the authorisation header - which may be why it’s not working so well in Node-Red.

Mostly people seem to use MQTT with Node-Red …

---

<div class="post-metadata">

**Author:** ![NordBase](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/nordbase/32/35697_2.png) [@NordBase](https://www.thethingsnetwork.org/forum/u/NordBase)\
**Post date:** [February 26, 2021, 6:55am UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/8 "2021-02-26T06:55:35Z")

</div>

Probably issue refer to authorization header and I tried build flow node red but without success.  
I also used MQTT for “live” data but my aplication needs data logger.  
Idea was not to use DB on node-red side that must be running all time but integrate with Stack v3 storage and get part of data defined via query in http request.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [February 26, 2021, 11:23am UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/9 "2021-02-26T11:23:50Z")

</div>

> [@NordBase](#):
>
> I also used MQTT for “live” data but my aplication needs data logger.

Can you put the incoming live data in to a local database, so you aren’t reliant on the Data Storage?

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [March 28, 2021, 11:23am UTC](https://www.thethingsnetwork.org/forum/t/get-decoded-payload-from-uplink-message-out-of-storage-integration-http-reuqest/43787/10 "2021-03-28T11:23:59Z")

</div>

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