TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAilabsIotDeviceControlNotifyRequest req = new AlibabaAilabsIotDeviceControlNotifyRequest();
AlibabaAilabsIotDeviceControlNotifyRequest.NotifyVehicleControlParams obj1 = new AlibabaAilabsIotDeviceControlNotifyRequest.NotifyVehicleControlParams();
AlibabaAilabsIotDeviceControlNotifyRequest.Payload obj2 = new AlibabaAilabsIotDeviceControlNotifyRequest.Payload();
obj2.setErrorCode("INVALIDATE_PARAMS");
obj2.setMessage("请求参数有误");
obj2.setDeviceId("12345");
obj1.setPayload(obj2);
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonHeader obj3 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonHeader();
obj3.setNamespace("AliGenie.Iot.Device.Control");
obj3.setName("LockVehicleDoorResponse");
obj3.setMessageId("1bd5d003-31b9-476f-ad03-71d471922820");
obj3.setPayLoadVersion(1L);
obj1.setHeader(obj3);
List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty> list5 = new ArrayList<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty>();
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty obj6 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty();
list5.add(obj6);
obj6.setName("LFDoor");
obj6.setValue("on");
obj1.setExceptions(list5);
List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty> list8 = new ArrayList<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty>();
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty obj9 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDeviceProperty();
list8.add(obj9);
obj9.setName("vehicleLock");
obj9.setValue("locked");
obj1.setProperties(list8);
req.setNotifyControlParams(obj1);
AlibabaAilabsIotDeviceControlNotifyResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAilabsIotDeviceControlNotifyRequest req = new AlibabaAilabsIotDeviceControlNotifyRequest();
AlibabaAilabsIotDeviceControlNotifyRequest.NotifyVehicleControlParamsDomain obj1 = new AlibabaAilabsIotDeviceControlNotifyRequest.NotifyVehicleControlParamsDomain();
AlibabaAilabsIotDeviceControlNotifyRequest.PayloadDomain obj2 = new AlibabaAilabsIotDeviceControlNotifyRequest.PayloadDomain();
obj2.ErrorCode = "INVALIDATE_PARAMS";
obj2.Message = "请求参数有误";
obj2.DeviceId = "12345";
obj1.Payload= obj2;
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonHeaderDomain obj3 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonHeaderDomain();
obj3.Namespace = "AliGenie.Iot.Device.Control";
obj3.Name = "LockVehicleDoorResponse";
obj3.MessageId = "1bd5d003-31b9-476f-ad03-71d471922820";
obj3.PayLoadVersion = 1L;
obj1.Header= obj3;
List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain> list5 = new List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain>();
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain obj6 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain();
list5.Add(obj6);
obj6.Name = "LFDoor";
obj6.Value = "on";
obj1.Exceptions= list5;
List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain> list8 = new List<AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain>();
AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain obj9 = new AlibabaAilabsIotDeviceControlNotifyRequest.IotCommonDevicePropertyDomain();
list8.Add(obj9);
obj9.Name = "vehicleLock";
obj9.Value = "locked";
obj1.Properties= list8;
req.NotifyControlParams_ = obj1;
AlibabaAilabsIotDeviceControlNotifyResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAilabsIotDeviceControlNotifyRequest;
$notify_control_params = new NotifyVehicleControlParams;
$payload = new Payload;
$payload->error_code="INVALIDATE_PARAMS";
$payload->message="请求参数有误";
$payload->device_id="12345";
$notify_control_params->payload = $payload;
$header = new IotCommonHeader;
$header->namespace="AliGenie.Iot.Device.Control";
$header->name="LockVehicleDoorResponse";
$header->message_id="1bd5d003-31b9-476f-ad03-71d471922820";
$header->pay_load_version="1";
$notify_control_params->header = $header;
$exceptions = new IotCommonDeviceProperty;
$exceptions->name="LFDoor";
$exceptions->value="on";
$notify_control_params->exceptions = $exceptions;
$properties = new IotCommonDeviceProperty;
$properties->name="vehicleLock";
$properties->value="locked";
$notify_control_params->properties = $properties;
$req->setNotifyControlParams(json_encode($notify_control_params));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.ailabs.iot.device.control.notify' \
-d 'partner_id=apidoc' \
-d 'sign=5B88F53B88ACA77DBAE4227F1AE99103' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-03+22%3A48%3A33' \
-d 'v=2.0' \
-d 'notify_control_params=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAilabsIotDeviceControlNotifyRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.notify_control_params=""
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.ailabs.iot.device.control.notify");
add_param(pRequest,"notify_control_params","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.ailabs.iot.device.control.notify', {
'notify_control_params':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})