Skip to content

Commit e9c8d16

Browse files
committed
Updated Request connector documentation
1 parent 0cdd125 commit e9c8d16

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

_includes/templates/iot-gateway/request-converter-json-config.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,40 @@ Mapping subsection will look like:
5656
}
5757
}
5858
```
59+
60+
Also, you can combine values from MQTT message in attributes, telemetry and serverSideRpc section, for example:
61+
```json
62+
{
63+
"url": "getdata",
64+
"httpMethod": "GET",
65+
"httpHeaders": {
66+
"ACCEPT": "application/json"
67+
},
68+
"allowRedirects": true,
69+
"timeout": 0.5,
70+
"scanPeriod": 5,
71+
"converter": {
72+
"type": "json",
73+
"deviceNameJsonExpression": "SD8500",
74+
"deviceTypeJsonExpression": "SD",
75+
"attributes": [],
76+
"telemetry": [
77+
{
78+
"type": "double",
79+
"key": "temperature",
80+
"value": "${temp}"
81+
},
82+
{
83+
"type": "double",
84+
"key": "humidity",
85+
"value": "${hum}"
86+
},
87+
{
88+
"type": "string",
89+
"key": "combine",
90+
"value": "${hum}:${temp}"
91+
}
92+
]
93+
}
94+
}
95+
```

docs/iot-gateway/config/request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Examples for both methods provided below.
305305
"methodFilter": "no-reply",
306306
"requestUrlExpression": "sensor/${deviceName}/request/${methodName}/${requestId}",
307307
"httpMethod": "POST",
308-
"valueExpression": "${params}",
308+
"valueExpression": "${params.hum}",
309309
"httpHeaders": {
310310
"Content-Type": "application/json"
311311
}

0 commit comments

Comments
 (0)