TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusBsVoucherGetRequest req = new AlibabaCampusBsVoucherGetRequest();
AlibabaCampusBsVoucherGetRequest.VoucherQuery obj1 = new AlibabaCampusBsVoucherGetRequest.VoucherQuery();
obj1.setVoucherType("QR_CODE");
obj1.setIsGeneratePic(false);
obj1.setMobile("18209090909");
obj1.setUserName("张三");
obj1.setIdno("1");
obj1.setSponsorCode("xxx");
obj1.setActivityCode("1");
obj1.setQrCodeTypeEnum("DYNAMIC");
obj1.setAccessKey("1");
obj1.setMoziId("1");
obj1.setValidTime(300L);
obj1.setEmail("1");
req.setParam(obj1);
AlibabaCampusBsVoucherGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaCampusBsVoucherGetRequest req = new AlibabaCampusBsVoucherGetRequest();
AlibabaCampusBsVoucherGetRequest.VoucherQueryDomain obj1 = new AlibabaCampusBsVoucherGetRequest.VoucherQueryDomain();
obj1.VoucherType = "QR_CODE";
obj1.IsGeneratePic = false;
obj1.Mobile = "18209090909";
obj1.UserName = "张三";
obj1.Idno = "1";
obj1.SponsorCode = "xxx";
obj1.ActivityCode = "1";
obj1.QrCodeTypeEnum = "DYNAMIC";
obj1.AccessKey = "1";
obj1.MoziId = "1";
obj1.ValidTime = 300L;
obj1.Email = "1";
req.Param_ = obj1;
AlibabaCampusBsVoucherGetResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaCampusBsVoucherGetRequest;
$param = new VoucherQuery;
$param->voucher_type="QR_CODE";
$param->is_generate_pic="false";
$param->mobile="18209090909";
$param->user_name="张三";
$param->idno="1";
$param->sponsor_code="xxx";
$param->activity_code="1";
$param->qr_code_type_enum="DYNAMIC";
$param->access_key="1";
$param->mozi_id="1";
$param->valid_time="300";
$param->email="1";
$req->setParam(json_encode($param));
$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.bs.voucher.get' \
-d 'partner_id=apidoc' \
-d 'sign=77B803E3E4103F149D783F15D57BDEC9' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-26+09%3A05%3A51' \
-d 'v=2.0' \
-d 'param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaCampusBsVoucherGetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param=""
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.bs.voucher.get");
add_param(pRequest,"param","数据结构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.bs.voucher.get', {
'param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})