TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest req = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest();
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.WorkBenchContext obj1 = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.WorkBenchContext();
obj1.setCompanyId(10000L);
obj1.setSystemId("111111111");
obj1.setCampusCode("111111");
obj1.setCampusId(10000L);
obj1.setLanguage("en");
obj1.setAppCode("1234");
obj1.setUserName("zy");
obj1.setUserId(1111334455L);
req.setWorkBenchContext(obj1);
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.DeviceApiQuery obj2 = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.DeviceApiQuery();
obj2.setCode("测试");
obj2.setCampusIdList(new Long[] { };
);
obj2.setTemplateCode("Face");
obj2.setUuidList(""uuid","uuid2"");
obj2.setFloorId(1L);
obj2.setBuildingIdList(new Long[] { };
);
obj2.setSpaceId(1L);
obj2.setSpaceIdList(new Long[] { };
);
obj2.setLimit(10L);
obj2.setBeRun(true);
obj2.setKey("测试");
obj2.setRunStatus(1L);
obj2.setFloorIdList(new Long[] { 1,2 };
);
obj2.setTemplateCodeList(""Face","Face2"");
obj2.setCampusId(10000L);
obj2.setTagName("aaa");
obj2.setBuildingId(10001L);
obj2.setCompanyId(10000L);
obj2.setNameOrCode("aaaa");
obj2.setCurrentPage(1L);
req.setQuery(obj2);
AlibabaCampusDeviceOpenapiGetdeviceforqueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest req = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest();
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.WorkBenchContextDomain obj1 = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.WorkBenchContextDomain();
obj1.CompanyId = 10000L;
obj1.SystemId = "111111111";
obj1.CampusCode = "111111";
obj1.CampusId = 10000L;
obj1.Language = "en";
obj1.AppCode = "1234";
obj1.UserName = "zy";
obj1.UserId = 1111334455L;
req.WorkBenchContext_ = obj1;
AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.DeviceApiQueryDomain obj2 = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest.DeviceApiQueryDomain();
obj2.Code = "测试";
obj2.CampusIdList = new long[] { };
;
obj2.TemplateCode = "Face";
obj2.UuidList = ""uuid","uuid2"";
obj2.FloorId = 1L;
obj2.BuildingIdList = new long[] { };
;
obj2.SpaceId = 1L;
obj2.SpaceIdList = new long[] { };
;
obj2.Limit = 10L;
obj2.BeRun = true;
obj2.Key = "测试";
obj2.RunStatus = 1L;
obj2.FloorIdList = new long[] { 1,2 };
;
obj2.TemplateCodeList = ""Face","Face2"";
obj2.CampusId = 10000L;
obj2.TagName = "aaa";
obj2.BuildingId = 10001L;
obj2.CompanyId = 10000L;
obj2.NameOrCode = "aaaa";
obj2.CurrentPage = 1L;
req.Query_ = obj2;
AlibabaCampusDeviceOpenapiGetdeviceforqueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest;
$work_bench_context = new WorkBenchContext;
$work_bench_context->company_id="10000";
$work_bench_context->system_id="111111111";
$work_bench_context->campus_code="111111";
$work_bench_context->campus_id="10000";
$work_bench_context->language="en";
$work_bench_context->app_code="1234";
$work_bench_context->user_name="zy";
$work_bench_context->user_id="1111334455";
$req->setWorkBenchContext(json_encode($work_bench_context));
$query = new DeviceApiQuery;
$query->code="测试";
$query->campus_id_list="";
$query->template_code="Face";
$query->uuid_list="[\"uuid\",\"uuid2\"]";
$query->floor_id="1";
$query->building_id_list="";
$query->space_id="1";
$query->space_id_list="";
$query->limit="10";
$query->be_run="true";
$query->key="测试";
$query->run_status="1";
$query->floor_id_list="[1,2]";
$query->template_code_list="[\"Face\",\"Face2\"]";
$query->campus_id="10000";
$query->tag_name="aaa";
$query->building_id="10001";
$query->company_id="10000";
$query->name_or_code="aaaa";
$query->current_page="1";
$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.getdeviceforquery' \
-d 'partner_id=apidoc' \
-d 'sign=B1393637B90802FA8451513351580085' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-25+19%3A19%3A41' \
-d 'v=2.0' \
-d 'query=null' \
-d 'work_bench_context=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaCampusDeviceOpenapiGetdeviceforqueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.work_bench_context="数据结构示例JSON格式"
req.query="数据结构示例JSON格式"
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.getdeviceforquery");
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.getdeviceforquery', {
'work_bench_context':'数据结构JSON示例',
'query':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})