Update Subscription Group

Update the subscription group information.

Request format

PUT http://{apigw-address}/dataService/subscribeGroups/{subscribeGroupId}?orgId={}

Request parameters (URI)

Request parameters (URI)

Name

Location (Path/Query)

Required or not

Data type

Description

subscribeGroupId

Path

Yes

String

Subscription group ID

orgId

Query

Yes

String

Organization ID which the asset belongs to. How to get orgId>>

Note

Replace {subscribeGroupId} with the subscription group ID instead of using “subscribeGroupId= Subscription group ID”.

Request parameters (Body)

Request parameters (Body)

Name

Required or not

Data type

Description

subscribeGroupId

True

String

Subscription group ID. It must begin with DATASVC.SUBALL. or DATASVC.SUB.. Only upper cases and lower cases of English letters, numbers, underline (_), English period (.) and hyphen (-) are supported, and its length is limited within 60 bytes.

enable

False

boolean

Whether to enable the subscription group.

subscribeAll

False

boolean

Whether to subscribe all the measurement point information. If it is True, the value of subscribeGroupId must be attached with the DATASVC.SUBALL. prefix. if it is False, the value of subscribeGroupId must be attached with the DATASVC.SUB. prefix.

subscribeModelList

False

Array

List of the subscribed models, where the data element is the model identifier.

subscribeProductList

False

Array

List of the subscribed products, where the data element is the product key.

subscribeAssetList

False

Array

List of the subscribed assets, where the data element is the asset ID.

subscribeDeviceList

False

Array

List of the subscribed devices, where the list element is the object, and its structure is shown in the table below.

subscribeModelPointList

False

Array

Measurement points of the subscribed models, where the list element is the object, and its structure is shown in the table below.

subscribePointList

False

Array

List of the information of the measurement points associated to the subscribed devices, where the list element is the object, and its structure is shown in the table below.

subscribeDeviceList structure

Name

Required or not

Data type

Description

productKey

False

String

Product key of device

deviceKey

False

String

Device key of device

subscribeModelPointList structure

Name

Required or not

Data type

Description

modelId

False

String

Identifier of the model that the device belongs to

pointList

False

Array

List of measurement point IDs

subscribePointList structure

Name

Required or not

Data type

Description

assetId

False

String

Asset ID of the device asset that the measurement point belongs to, which is used to specify a device asset

productKey

False

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

False

String

Device key of the product that the measurement point belongs to, which is used to specify a device asset along with the productKey

pointList

False

Array

List of point IDs, where the list element is the point ID

Note

In the subscribePointList object, you may only use assetId or the combination of productKey and deviceKey to identify a device asset. If all the three parameters exist in the subscribePointList, the assetId will be used to identify the device.

Response parameters

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

data object

Name

Data type

Description

id

String

Internally defined data identifier

subscribeGroupId

String

Subscription group ID

enable

Boolean

Whether to enable the subscription group

subscribeAll

Boolean

Whether the subscription group subscribes all the measurement points

subscribeModelList

Array

List of the subscribed models, where the list element is the model identifier

subscribeProductList

Array

List of the subscribed products, where the list element is the Product Key

subscribeAssetList

Array

List of the subscribed assets, where the list element is the asset identifier

subscribeDeviceList

Array

List of the subscribed devices, where the list element is the object, and its structure is shown in the table below.

subscribeModelPointList

Array

List of the measurement points associated to the subscribed models, where the list element is the object, and its structure is shown in the table below.

subscribePointList

Array

List of the points associated to the subscribed devices, where the list element is the object, and its structure is shown in the table below.

subscribeDeviceList structure

Name

Data type

Description

productKey

String

Product key of the subscribed device

deviceKey

String

Device key of the subscribed device

subscribeModelPointList structure

Name

Data type

Description

modelId

String

Identifier of the model that the device belongs to

pointList

Array

List of point IDs, where the list element is the point ID

subscribePointList structure

Name

Required or not

Description

assetId

String

assetId of the device asset that the measurement point belongs to, which is used to specify a device asset

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

pointList

Array

List of measurement point IDs

Note

In the subscribePointList object, the assetId is preferred to identify a device. If assetId does not exist, the combination of deviceKey and productKey will be used to identify a device.

Input/output samples

Request sample

PUT  http://{apigw-address}/dataService/subscribeGroups/{subscribeGroupId}?orgId=o15434988531231
{
   "subscribeGroupId":"DATASVC.SUB.group1",
   "enable":true,
   "persistent":true,
   "subscribeAll":false,
   "subscribeModelList":[
      "model1",
      "model2",
      "model3"
   ],
   "subscribeProductList":[
      "product1",
      "product2",
      "product3"
   ],
   "subscribeAssetList":[
      "asset1",
      "asset2",
      "asset3"
   ],
   "subscribeDeviceList":[
      {
         "productKey":"productKey1",
         "deviceKey":"deviceKey1"
      },
      {
         "productKey":"productKey2",
         "deviceKey":"deviceKey2"
      }
   ],
   "subscribeModelPointList":[
      {
         "modelId":"model1",
         "pointList":[
            "point1",
            "point2",
            "point3"
         ]
      },
      {
         "modelId":"model2",
         "pointList":[
            "point1",
            "point2",
            "point3"
         ]
      }
   ],
   "subscribePointList":[
      {
         "assetId":"asset10",
         "productKey":"productKey10",
         "deviceKey":"deviceKey10",
         "pointList":[
            "point1",
            "point2",
            "point3"
         ]
      },
      {
         "assetId":"",
         "productKey":"productKey11",
         "deviceKey":"deviceKey11",
         "pointList":[
            "point1",
            "point2",
            "point3"
         ]
      }
   ]
}

Response sample

{
   "status":0,
   "msg":"Success",
   "submsg":null,
   "data":{
      "id":"dafdsfdsafsdaf",
      "subscribeGroupId":"DATASVC.SUB.group1",
      "enable":true,
      "persistent":true,
      "subscribeAll":false,
      "subscribeModelList":[
         "model1",
         "model2",
         "model3"
      ],
      "subscribeProductList":[
         "product1",
         "product2",
         "product3"
      ],
      "subscribeAssetList":[
         "asset1",
         "asset2",
         "asset3"
      ],
      "subscribeDeviceList":[
         {
            "productKey":"productKey1",
            "deviceKey":"deviceKey1"
         },
         {
            "productKey":"productKey2",
            "deviceKey":"deviceKey2"
         }
      ],
      "subscribeModelPointList":[
         {
            "modelId":"model1",
            "pointList":[
               "point1",
               "point2",
               "point3"
            ]
         },
         {
            "modelId":"model2",
            "pointList":[
               "point1",
               "point2",
               "point3"
            ]
         }
      ],
      "subscribePointList":[
         {
            "assetId":"asset10",
            "productKey":"productKey10",
            "deviceKey":"deviceKey10",
            "pointList":[
               "point1",
               "point2",
               "point3"
            ]
         },
         {
            "assetId":"",
            "productKey":"productKey11",
            "deviceKey":"deviceKey11",
            "pointList":[
               "point1",
               "point2",
               "point3"
            ]
         }
      ]
   }
}