Set Multiple Measurement Points Asynchronously¶
Set the measurement points in a asynchronous and multi-point way.
Request Format¶
PUT http://{apigw-address}/edge-service/v1/commands?action=setMeasurepointAsync&orgId={}
Request Parameters (URI)¶
Name | Location (Path/Query) | Required or not | Data type | Description |
---|---|---|---|---|
orgId | Query | Yes | String | Organization ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name | Required or not | Data type | Description |
---|---|---|---|
data | True | Object | Information about setting measurement points. See the table below for its structure. |
Name | Required or not | Data type | Description |
---|---|---|---|
requestId | True | String | ID of the request for setting measurement points |
orgId | True | String | OU ID |
callType | False | String | Call type. The value ASYNC means asynchronous |
setMeasurepointChannelId | True | String | ID of the channel for setting measurement points |
productKey | True | String | Product key of the product that the measurement point belongs to, which is used to specify a device asset along with the deviceKey |
deviceKey | True | String | Device key of the product that the measurement point belongs to, which is used to specify a device asset along with the productKey |
assetId | True | String | Asset ID of the device asset that the measurement point belongs to, which is used to specify a device asset |
measurepointId | True | String | Target measurement point ID |
callbackUrl | False | String | Callback function URL |
inputData | False | Object | Input data, which consists of key-value pairs of input data |
timeout | False | Long | Timetout in milliseconds. Its default value is 30000 and maximum 300000. |
gmtSetMeasurepointRequest | False | Long | Time of setting the measurement points set by the caller. A UNIX timestamp in milliseconds. If the value is null or not greater than 0, the current system time will be used. |
Note
In the subscribePointList object, the assetId is prioritized to identify a device. If assetId does not exist, the combination of deviceKey and productKey will be used to identify a device.
Response Parameters¶
Name | Data type | Description |
---|---|---|
status | Int | Status code |
msg | String | Response message |
submsg | String | Response sub-message |
data | Object | Response data object, the structure of which is in the table below |
Name | Data type | Description |
---|---|---|
requestId | String | Identifier of the request for setting measurement points |
orgId | String | OU ID |
callType | String | Invocation type, where the value “SYNC” means synchronous while the value “ASYNC” means asynchronous |
setMeasurepointChannelId | String | ID of the channel for setting measurement points |
productKey | String | Product key of the product that the measurement point belongs to, which is used to specify a device asset along with the deviceKey |
deviceKey | String | Device key of the product that the measurement point belongs to, which is used to specify a device asset along with the productKey |
assetId | String | Asset ID of the device asset that the measurement point belongs to, which is used to specify a device asset |
measurepointId | String | Target measurement point ID |
callbackUrl | String | Callback function URL |
inputData | Object | Input data, which consists of key-value pairs |
status | Int | Result of measurement point setting, where 0 indicates success and other values indicate failure |
msg | String | Response message |
submsg | String | Response sub-message |
timeout | Long | Timeout |
gmtSetMeasurepointRequest | Long | Time for setting measurement points, which is a UNIX timestamp in milliseconds |
gmtSetMeasurepointReply | Long | Service response time, which is a UNIX timestamp in milliseconds |
Note
In the subscribePointList object, the assetId is prioritized to identify a device. If assetId does not exist, the combination of deviceKey and productKey will be used to identify a device.
Samples¶
Request Sample¶
PUT http://{apigw-address}/dataService/devices/multiSet?orgId=o15434988531231
{
"data":[
{
"requestId":"dfsadfdsafdsaf",
"orgId":"adadad",
"callType":"ASYNC",
"setMeasurepointChannelId":"DATASVC.SET.afdasfasdf",
"productKey":"dfasdf",
"deviceKey":"dsfa",
"assetId":"aaa",
"measurepointId":"bbb",
"callbackUrl":null,
"inputData":{
"arg":10
},
"timeout":30000,
"gmtSetMeasurepointRequest":132132465464
},
{
"requestId":"12321321321",
"orgId":"adadad",
"callType":"ASYNC",
"setMeasurepointChannelId":"DATASVC.SET.afdasfasdf",
"productKey":"dfasdf",
"deviceKey":"dsfa",
"assetId":"aaa",
"measurepointId":"ccc",
"callbackUrl":null,
"inputData":{
"arg":11
},
"timeout":30000,
"gmtSetMeasurepointRequest":132132465464
}
]
}
Response Sample¶
{
"status":0,
"msg":"Success",
"submsg":null,
"data":[
{
"requestId":"testRequestId1",
"orgId":"aaa",
"callType":"ASYNC",
"setMeasurepointChannelId":"DATASVC.SET.setMeasurepointChannelId1",
"productKey":"6Bt59ySj",
"deviceKey":"zBAofs6D4s",
"assetId":"YCdyvNmc",
"measurepointId":"measurepointId1",
"callbackUrl":null,
"inputData":{
"testArg":1.0
},
"status":1000,
"msg":"para error",
"submsg":"para error",
"timeout":30000,
"gmtSetMeasurepointRequest":1536638267507,
"gmtSetMeasurepointReply":1536638267509
},
{
"requestId":"testRequestId2",
"orgId":"aaa",
"requestMethod":"thing.service.d",
"callType":"ASYNC",
"setMeasurepointChannelId":"DATASVC.SET.setMeasurepointChannelId1",
"productKey":"6Bt59ySj",
"deviceKey":"zBAofs6D4s",
"assetId":"YCdyvNmc",
"measurepointId":"measurepointId2",
"callbackUrl":null,
"inputData":{
"testArg":1.0
},
"status":1000,
"msg":"para error",
"submsg":"para error",
"timeout":30000,
"gmtSetMeasurepointRequest":1536638267507,
"gmtSetMeasurepointReply":1536638267509
}
]
}