TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallCampusShareWeilaiDeviceInsertRequest req = new TmallCampusShareWeilaiDeviceInsertRequest();
TmallCampusShareWeilaiDeviceInsertRequest.XiZhiLangDeviceCreateReq obj1 = new TmallCampusShareWeilaiDeviceInsertRequest.XiZhiLangDeviceCreateReq();
obj1.setProdCode("P4002");
obj1.setCatCode("C0004");
obj1.setMachineCode("HG99999");
obj1.setAddress("虚空");
obj1.setModuleCode("MH42002");
obj1.setCampusAreaCode("500099");
obj1.setModuleModel("XIZHILANG-XF-002");
obj1.setImei("869994065223579");
obj1.setDeviceModel("Haier_HG9kg_Drier");
obj1.setDeviceName("喜之郎TOP测试烘干机");
obj1.setBuildingId(74L);
obj1.setAttrJson("\"{}\"");
req.setXiZhiLangDeviceCreateReq(obj1);
TmallCampusShareWeilaiDeviceInsertResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallCampusShareWeilaiDeviceInsertRequest req = new TmallCampusShareWeilaiDeviceInsertRequest();
TmallCampusShareWeilaiDeviceInsertRequest.XiZhiLangDeviceCreateReqDomain obj1 = new TmallCampusShareWeilaiDeviceInsertRequest.XiZhiLangDeviceCreateReqDomain();
obj1.ProdCode = "P4002";
obj1.CatCode = "C0004";
obj1.MachineCode = "HG99999";
obj1.Address = "虚空";
obj1.ModuleCode = "MH42002";
obj1.CampusAreaCode = "500099";
obj1.ModuleModel = "XIZHILANG-XF-002";
obj1.Imei = "869994065223579";
obj1.DeviceModel = "Haier_HG9kg_Drier";
obj1.DeviceName = "喜之郎TOP测试烘干机";
obj1.BuildingId = 74L;
obj1.AttrJson = "\"{}\"";
req.XiZhiLangDeviceCreateReq_ = obj1;
TmallCampusShareWeilaiDeviceInsertResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallCampusShareWeilaiDeviceInsertRequest;
$xi_zhi_lang_device_create_req = new XiZhiLangDeviceCreateReq;
$xi_zhi_lang_device_create_req->prod_code="P4002";
$xi_zhi_lang_device_create_req->cat_code="C0004";
$xi_zhi_lang_device_create_req->machine_code="HG99999";
$xi_zhi_lang_device_create_req->address="虚空";
$xi_zhi_lang_device_create_req->module_code="MH42002";
$xi_zhi_lang_device_create_req->campus_area_code="500099";
$xi_zhi_lang_device_create_req->module_model="XIZHILANG-XF-002";
$xi_zhi_lang_device_create_req->imei="869994065223579";
$xi_zhi_lang_device_create_req->device_model="Haier_HG9kg_Drier";
$xi_zhi_lang_device_create_req->device_name="喜之郎TOP测试烘干机";
$xi_zhi_lang_device_create_req->building_id="74";
$xi_zhi_lang_device_create_req->attr_json="\"{}\"";
$req->setXiZhiLangDeviceCreateReq(json_encode($xi_zhi_lang_device_create_req));
$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=tmall.campus.share.weilai.device.insert' \
-d 'partner_id=apidoc' \
-d 'sign=40240E51B6F294121156BED2A8B34186' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-16+02%3A57%3A30' \
-d 'v=2.0' \
-d 'xi_zhi_lang_device_create_req=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallCampusShareWeilaiDeviceInsertRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.xi_zhi_lang_device_create_req="数据结构示例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,"tmall.campus.share.weilai.device.insert");
add_param(pRequest,"xi_zhi_lang_device_create_req","数据结构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('tmall.campus.share.weilai.device.insert', {
'xi_zhi_lang_device_create_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})