Skip to content

Batch Control Devices

API Address:/v2/binding/enduserapi/batchControlDevice

Request Method:POST

Request Data Type:application/json

Response Data Type:*/*

API Description:Batch control devices

Request Example:

javascript
{
  "cacheTime": 0,
  "data": "",
  "dataFormat": 0,
  "deviceList": [
    {
      "deviceKey": "",
      "gatewayDeviceKey": "",
      "gatewayProductKey": "",
      "productKey": ""
    }
  ],
  "isCache": 0,
  "isCover": 0,
  "qos": 0,
  "type": 0
}

Request Parameters:

Parameter NameParameter DescriptionRequest TypeRequiredData TypeSchema
paramparambodytrueBatch Control DeviceBatch Control Device
  cacheTimeCache time in seconds, range 1-7776000 seconds, must be set when cache is enabledfalseinteger(int32)
  dataDevice control command. When type is passthrough, maximum command length is 4096truestring
  dataFormatData type 1: Hex 2: Text (when type is passthrough, dataFormat must be specified)falseinteger(int32)
  deviceListDevice listtruearraypkdk
    deviceKeyDevice deviceKeytruestring
    gatewayDeviceKeyGateway device deviceKeyfalsestring
    gatewayProductKeyGateway product productKeyfalsestring
    productKeyProduct productKeytruestring
  isCacheWhether to enable cache 1: Enable 2: Disable, default is disabledfalseinteger(int32)
  isCoverWhether to overwrite previously sent identical commands 1: Overwrite 2: Don't overwrite, default is don't overwrite, this parameter is valid when cache is enabledfalseinteger(int32)
  qosQoS level setting, parameter value range 0, 1, default is 1falseinteger(int32)
  typeType 1: Passthrough 2: Property 3: Servicetrueinteger(int32)

Response Status:

Status CodeDescriptionSchema
200Batch control devices successfulRegistration code response data«PkdkResult»
5032Token verification failed
5041No permission
5070Please enter type
5071Type error, types are 1: Passthrough 2: Property 3: Service
5072Please enter data type
5073Data type error, data types are 1: Hex 2: Text (when type is passthrough, dataFormat must be specified)
5074Please enter device control command
5075Device control command length cannot exceed 4096
5106Please enter token
5311Please enter device list
5312Total number of devices in list exceeds range
5328Please enter cache time
5329Cache time out of range
5330Whether to enable cache is out of range
5331Whether to overwrite previously sent identical commands is out of range
5340Batch control devices failed

Response Parameters:

Parameter NameParameter DescriptionTypeSchema
codeResponse status codeinteger(int32)integer(int32)
dataResponse dataPkdkResultPkdkResult
  failureListFailure listarrayPkdkMsg
    datapkdkpkdk
      deviceKeyDevice deviceKeystring
      gatewayDeviceKeyGateway device deviceKeystring
      gatewayProductKeyGateway product productKeystring
      productKeyProduct productKeystring
    msgstring
  successListSuccess listarrayPkdkSuc
    datapkdkpkdk
      deviceKeyDevice deviceKeystring
      gatewayDeviceKeyGateway device deviceKeystring
      gatewayProductKeyGateway product productKeystring
      productKeyProduct productKeystring
    ticketstring
extMsgExtended messagestring
msgResponse messagestring

Response Example:

javascript
{
	"code": 0,
	"data": {
		"failureList": [
			{
				"data": {
					"deviceKey": "",
					"gatewayDeviceKey": "",
					"gatewayProductKey": "",
					"productKey": ""
				},
				"msg": ""
			}
		],
		"successList": [
			{
				"data": {
					"deviceKey": "",
					"gatewayDeviceKey": "",
					"gatewayProductKey": "",
					"productKey": ""
				},
				"ticket": ""
			}
		]
	},
	"extMsg": "",
	"msg": ""
}