Skip to content

Commit 1b925d8

Browse files
committed
doc: Add attributes to uplink message data format
1 parent fc82492 commit 1b925d8

File tree

1 file changed

+22
-17
lines changed
  • doc/content/integrations/data-formats

1 file changed

+22
-17
lines changed

doc/content/integrations/data-formats/_index.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ The JSON join-accept messages use the following format:
3737
"received_at" : "2020-02-12T15:15..." // ISO 8601 UTC timestamp at which the message has been received by the Application Server
3838
"join_accept" : {
3939
"session_key_id" : "AXBSH1Pk6Z0G166...", // Join Server issued identifier for the session keys
40-
"received_at" : "2020-02-17T07:49..." // ISO 8601 UTC timestamp at which the uplink has been received by the Network Server
40+
"received_at" : "2020-02-17T07:49...", // ISO 8601 UTC timestamp at which the uplink has been received by the Network Server
41+
"attributes": { // End device key-value attributes set for this device.
42+
"key1": "value1",
43+
"key2": "value2"
44+
}
4145
}
4246
}
4347
```
@@ -62,10 +66,14 @@ The JSON join-accept messages use the following format:
6266
"ns:uplink:01E191YMZ2J64K6FEW5F0WE7TQ",
6367
"rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E191YMZ2KK3TJYG5C4XZP8JK"
6468
],
65-
"received_at": "2020-02-17T07:49:09.935284891Z",
66-
"join_accept": {
67-
"session_key_id": "AXBSH1Pk6Z0G166RlH16CQ==",
68-
"received_at": "2020-02-17T07:49:09.736532315Z"
69+
"received_at" : "2020-02-17T07:49:09.935284891Z",
70+
"join_accept" : {
71+
"session_key_id" : "AXBSH1Pk6Z0G166RlH16CQ==",
72+
"received_at" : "2020-02-17T07:49:09.736532315Z",
73+
"attributes": {
74+
"key1": "value1",
75+
"key2": "value2"
76+
}
6977
}
7078
}
7179
```
@@ -148,6 +156,10 @@ The JSON uplink messages use the following format:
148156
"net_id": "000013", // Network ID
149157
"tenant_id": "tenant1", // Tenant ID
150158
"cluster_id": "eu1" // Cluster ID
159+
},
160+
"attributes": { // End device key-value attributes set for this device.
161+
"key1": "value1",
162+
"key2": "value2"
151163
}
152164
},
153165
"simulated": true, // Signals if the message is coming from the Network Server or is simulated.
@@ -231,23 +243,16 @@ The JSON uplink messages use the following format:
231243
"tenant_id": "tenant1",
232244
"cluster_id": "nam1"
233245
},
234-
"received_at": "2020-02-12T15:15:45.789585559Z"
246+
"attributes": {
247+
"key1": "value1",
248+
"key2": "value2"
249+
}
250+
"received_at" : "2020-02-12T15:15:45.789585559Z"
235251
}
236252
}
237253
```
238-
239254
</details>
240255

241-
{{< note >}} End device key-value attributes are not included in uplink messages, because these attributes are stored in the Identity Server and normally they are static, so sending that data with every uplink is inefficient. Users can instead fetch device's attributes using the API:
242-
243-
```bash
244-
curl --request GET /
245-
--location 'https://thethings.example.com/api/v3/applications/<application-id>/devices/<device-id>?field_mask=attributes' /
246-
--header "Authorization: Bearer <api-key>"
247-
```
248-
249-
{{</ note >}}
250-
251256
### Downlink Events Messages
252257

253258
The JSON downlink `ack`, `nack`, `queued` and `sent` events messages use the following format:

0 commit comments

Comments
 (0)