TTN V3 Storage Intergration

Hi everyone,

All information are stored in the V3 integration.
Is there a way to get only decoded payload and the device ID when I send requests to the Stortage Intergration API V3?
If not, is there a way to save only the decoded payload and ID’s in the storage API (like in V2)?

Thanks

Yes, if you read the docs you can specify which fields you want returned.

If I refer to this doc : https://www.thethingsindustries.com/docs/api/reference/grpc/storage_integration/
I can only choose to get Uplink message with /api/v3/as/applications/{application_ids.application_id}/packages/storage/uplink_message

But I want to get only those informations :

{"result":{"end_device_ids":{"device_id":"XXXXXX","application_ids":{"application_id":"XXXXX"},"dev_eui":"XXXXXXXXXXXX","dev_addr":"XXXXX"},"received_at":"XXXXX","uplink_message":"decoded_payload":{"batterie":X,"temperature":XX.XX}}

So :
I try to get the payload with the correct Device ID with requests.get() in python

params = {'after': StartUtc,'Accept': 'text/event-stream'}
headers = {
	'Authorization': 'Bearer '+'APPKEY'
}
API = (requests.get(('https://eu1.cloud.thethings.network/api/v3/as/applications/'+'APPNAME'+'/packages/storage/uplink_message'),headers=headers,params=params)).text

But with those requests I get a lot of data that I don’t need…

If there is a way, can you give me a exemple of the URL?

No, because it’s not in the URL, it’s in the headers.

Review the docs, look around:

https://www.thethingsindustries.com/docs/reference/api/field-mask/

Thank you for your help Nick!
But I don’t fully understand the documentation.
Can you do more and give me an example of an Header correctly set for getting device decoded payload stored in Storage Intergration ? It will be great.
In python, it will be Perfect!
Any case, it will be helpful.

I only need this : “decoded_payload”:{“batterie”:X,“temperature”:XX.XX} & “device_id”:“XXXXXX”

I tried POST & GET requests with a lot of header setup but resquests were never successfully exept :

  • to get general informations about devices and application
  • to get the entire Storage integration data for the last X min (to long string for my use)

I’ll need a 24 hours to grab a few minutes to do it in Python

Thank you very much for your help

Here’s a link to some tested code:

http://descartes.co.uk/ttsv3/2021/03/17/TTS-v3-Data-Storage-download-via-Python-template.html

6 Likes

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