TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest req = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest();
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.WorkBenchContext obj1 = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.WorkBenchContext();
obj1.setCompanyId(10000L);
obj1.setCampusId(100001L);
req.setWorkBenchContext(obj1);
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.DeviceApiQuery obj2 = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.DeviceApiQuery();
obj2.setLimit(15L);
obj2.setFloorIdList(new Long[] { };
);
obj2.setTemplateCode("brightness_sensor");
obj2.setSpaceId(100004L);
obj2.setCampusIdList(new Long[] { 100001,100002 };
);
obj2.setBuildingIdList(new Long[] { };
);
obj2.setTemplateCodeList("brightness_sensor");
obj2.setFloorId(100004L);
obj2.setBeRun(true);
obj2.setRunStatus(0L);
obj2.setTagName("JACE");
obj2.setCurrentPage(1L);
obj2.setSpaceIdList(new Long[] { };
);
obj2.setUuidList("ca99e9e9-e40d-483e-a011-20a7a440450d");
obj2.setNameOrCode("a");
obj2.setCampusId(100001L);
obj2.setBuildingId(100001L);
obj2.setCode("8-5-W1-6");
req.setQuery(obj2);
AlibabaCampusDeviceOpenapiGetsimpledevicelistResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest req = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest();
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.WorkBenchContextDomain obj1 = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.WorkBenchContextDomain();
obj1.CompanyId = 10000L;
obj1.CampusId = 100001L;
req.WorkBenchContext_ = obj1;
AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.DeviceApiQueryDomain obj2 = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest.DeviceApiQueryDomain();
obj2.Limit = 15L;
obj2.FloorIdList = new long[] { };
;
obj2.TemplateCode = "brightness_sensor";
obj2.SpaceId = 100004L;
obj2.CampusIdList = new long[] { 100001,100002 };
;
obj2.BuildingIdList = new long[] { };
;
obj2.TemplateCodeList = "brightness_sensor";
obj2.FloorId = 100004L;
obj2.BeRun = true;
obj2.RunStatus = 0L;
obj2.TagName = "JACE";
obj2.CurrentPage = 1L;
obj2.SpaceIdList = new long[] { };
;
obj2.UuidList = "ca99e9e9-e40d-483e-a011-20a7a440450d";
obj2.NameOrCode = "a";
obj2.CampusId = 100001L;
obj2.BuildingId = 100001L;
obj2.Code = "8-5-W1-6";
req.Query_ = obj2;
AlibabaCampusDeviceOpenapiGetsimpledevicelistResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest;
$work_bench_context = new WorkBenchContext;
$work_bench_context->company_id="10000";
$work_bench_context->campus_id="100001";
$req->setWorkBenchContext(json_encode($work_bench_context));
$query = new DeviceApiQuery;
$query->limit="15";
$query->floor_id_list="[]";
$query->template_code="brightness_sensor";
$query->space_id="100004";
$query->campus_id_list="100001,100002";
$query->building_id_list="[]";
$query->template_code_list="brightness_sensor";
$query->floor_id="100004";
$query->be_run="true";
$query->run_status="0";
$query->tag_name="JACE";
$query->current_page="1";
$query->space_id_list="[]";
$query->uuid_list="ca99e9e9-e40d-483e-a011-20a7a440450d";
$query->name_or_code="a";
$query->campus_id="100001";
$query->building_id="100001";
$query->code="8-5-W1-6";
$req->setQuery(json_encode($query));
$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.campus.device.openapi.getsimpledevicelist' \
-d 'partner_id=apidoc' \
-d 'sign=32766A91FD04298515C56A8B19BE5D47' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-25+19%3A43%3A04' \
-d 'v=2.0' \
-d 'query=null' \
-d 'work_bench_context=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaCampusDeviceOpenapiGetsimpledevicelistRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.work_bench_context=""
req.query=""
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.campus.device.openapi.getsimpledevicelist");
add_param(pRequest,"work_bench_context","数据结构JSON示例");
add_param(pRequest,"query","数据结构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.campus.device.openapi.getsimpledevicelist', {
'work_bench_context':'数据结构JSON示例',
'query':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})