Synchronous Setting Points

Set the measurement point by Asset ID.

Request Format

POST http://{apigw-address}/edge-service/v1/commands?action=setMeasurepointByAssetId&assetId={}&measurepointId={}&orgId={}&timeout={}&requestId={}&transferWay={}

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>>

action

Query

Yes

String

setMeasurepointByAssetId

measurepointId

Query

Yes

String

Measurepoint ID

assetId

Query

Yes

String

Asset ID

timeout

Query

No

Long

Service timeout, unit (millisecond), default (30000), maximum (300000)

requestId

Query

Yes

String

Request ID

callbackUrl

Query

No

String

Callback URL

gmtSetMeasurepointRequest

Query

No

Long

Service response time, which is a UNIX timestamp in milliseconds

transferWay

Query

No

Integer

0 (default value, send real time data), 1(send changeable data)

Request parameters (Body)

Name

Data type

Required or not

Description

value

True

Object

Defined by model point data type

  • When model point type is String, fill in the string

  • When model point type is Double, fill in the number

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

transferWay

Integer

0 (default value, send real time data), 1(send changeable data)

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.

Sample

Request Sample

POST http://{apigw-address}/edge-service/v1/commands?action=setMeasurepointByAssetId&assetId={}&measurepointId={}&orgId={}&timeout={}&requestId={}&transferWay={}

{
    "value":10
}

Return Sample

{
    "status":0,
    "msg":"Success",
    "submsg":null,
    "data":{
        "requestId":"testRequestId",
        "orgId":"aaa",
        "callType":"SYNC",
        "setMeasurepointChannelId":"DATASVC.SET.setMeasurepointChannelId1",
        "productKey":"6Bt59ySj",
        "deviceKey":"zBAofs6D4s",
        "assetId":"YCdyvNmc",
        "measurepointId":"measurepointId1",
        "callbackUrl":null,
        "inputData":{
            "testArg":1.0
        },
        "status":0,
        "msg":"SUCCESS",
        "submsg":null,
        "timeout":30000,
        "gmtSetMeasurepointRequest":1536638267507,
        "gmtSetMeasurepointReply":1536638267509,
        "transferWay":0
    }
}