TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusDeviceGetdeviceforqueryRequest req = new AlibabaCampusDeviceGetdeviceforqueryRequest();
AlibabaCampusDeviceGetdeviceforqueryRequest.WorkBenchContext obj1 = new AlibabaCampusDeviceGetdeviceforqueryRequest.WorkBenchContext();
obj1.setCompanyId(10000L);
obj1.setCampusId(100001L);
req.setWorkBenchContext(obj1);
AlibabaCampusDeviceGetdeviceforqueryRequest.DeviceApiQuery obj2 = new AlibabaCampusDeviceGetdeviceforqueryRequest.DeviceApiQuery();
obj2.setKey("device");
obj2.setCampusId(100002L);
obj2.setTemplateCode("Light");
obj2.setLimit(15L);
obj2.setCurrentPage(1L);
obj2.setCampusIdList(new Long[] { };
);
req.setQuery(obj2);
AlibabaCampusDeviceGetdeviceforqueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaCampusDeviceGetdeviceforqueryRequest req = new AlibabaCampusDeviceGetdeviceforqueryRequest();
AlibabaCampusDeviceGetdeviceforqueryRequest.WorkBenchContextDomain obj1 = new AlibabaCampusDeviceGetdeviceforqueryRequest.WorkBenchContextDomain();
obj1.CompanyId = 10000L;
obj1.CampusId = 100001L;
req.WorkBenchContext_ = obj1;
AlibabaCampusDeviceGetdeviceforqueryRequest.DeviceApiQueryDomain obj2 = new AlibabaCampusDeviceGetdeviceforqueryRequest.DeviceApiQueryDomain();
obj2.Key = "device";
obj2.CampusId = 100002L;
obj2.TemplateCode = "Light";
obj2.Limit = 15L;
obj2.CurrentPage = 1L;
obj2.CampusIdList = new long[] { };
;
req.Query_ = obj2;
AlibabaCampusDeviceGetdeviceforqueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaCampusDeviceGetdeviceforqueryRequest;
$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->key="device";
$query->campus_id="100002";
$query->template_code="Light";
$query->limit="15";
$query->current_page="1";
$query->campus_id_list="[]";
$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.getdeviceforquery' \
-d 'partner_id=apidoc' \
-d 'sign=55B005C8514A1CDD1DA847F9D898EB07' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-06-26+15%3A24%3A01' \
-d 'v=2.0' \
-d 'query=null' \
-d 'work_bench_context=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaCampusDeviceGetdeviceforqueryRequest(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.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.getdeviceforquery', {
'work_bench_context':'数据结构JSON示例',
'query':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})