TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTicketRuleUploadRequest req = new AlitripTicketRuleUploadRequest();
req.setExtraDesc("补充说明");
req.setAliScenicId(24498L);
req.setVisitorLimitMode(1L);
req.setEnterType(1L);
req.setRefundDesc("退票描述");
req.setEnterVoucherType(2L);
req.setVisitorLimitNum(2L);
req.setEnterAddress("景区入园地址");
req.setVisitorRequire(1L);
req.setFeeInclude("门票费用包含");
req.setEnterVoucherValue("其他入园凭证类型");
req.setOutScenicId("111");
req.setTicketChangeAdderss("换票地址");
req.setOutRuleName("成人票规则");
req.setRuleStatus(0L);
req.setVisitorLimitAble(1L);
req.setRefundType(1L);
req.setRuleType(0L);
req.setOutRuleId("1234");
req.setVisitorInfos("2,3,4");
req.setVisitorLimitType(0L);
req.setAutoRefundSupport(1L);
req.setRefundCustomRules("[{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}]");
AlitripTicketRuleUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTicketRuleUploadRequest req = new AlitripTicketRuleUploadRequest();
req.ExtraDesc = "补充说明";
req.AliScenicId = 24498L;
req.VisitorLimitMode = 1L;
req.EnterType = 1L;
req.RefundDesc = "退票描述";
req.EnterVoucherType = 2L;
req.VisitorLimitNum = 2L;
req.EnterAddress = "景区入园地址";
req.VisitorRequire = 1L;
req.FeeInclude = "门票费用包含";
req.EnterVoucherValue = "其他入园凭证类型";
req.OutScenicId = "111";
req.TicketChangeAdderss = "换票地址";
req.OutRuleName = "成人票规则";
req.RuleStatus = 0L;
req.VisitorLimitAble = 1L;
req.RefundType = 1L;
req.RuleType = 0L;
req.OutRuleId = "1234";
req.VisitorInfos = "2,3,4";
req.VisitorLimitType = 0L;
req.AutoRefundSupport = 1L;
req.RefundCustomRules = "[{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}]";
AlitripTicketRuleUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTicketRuleUploadRequest;
$req->setExtraDesc("补充说明");
$req->setAliScenicId("24498");
$req->setVisitorLimitMode("1");
$req->setEnterType("1");
$req->setRefundDesc("退票描述");
$req->setEnterVoucherType("2");
$req->setVisitorLimitNum("2");
$req->setEnterAddress("景区入园地址");
$req->setVisitorRequire("1");
$req->setFeeInclude("门票费用包含");
$req->setEnterVoucherValue("其他入园凭证类型");
$req->setOutScenicId("111");
$req->setTicketChangeAdderss("换票地址");
$req->setOutRuleName("成人票规则");
$req->setRuleStatus("0");
$req->setVisitorLimitAble("1");
$req->setRefundType("1");
$req->setRuleType("0");
$req->setOutRuleId("1234");
$req->setVisitorInfos("2,3,4");
$req->setVisitorLimitType("0");
$req->setAutoRefundSupport("1");
$req->setRefundCustomRules("[{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}]");
$resp = $c->execute($req, $sessionKey);
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=alitrip.ticket.rule.upload' \
-d 'partner_id=apidoc' \
-d 'session=0fc42589-93f2-4530-baf6-6f8ed55ca0b9' \
-d 'sign=3525E73BCFF02AE6EEB2E69010C30EF1' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+23%3A03%3A00' \
-d 'v=2.0' \
-d 'ali_scenic_id=24498' \
-d 'auto_refund_support=1' \
-d 'enter_address=%E6%99%AF%E5%8C%BA%E5%85%A5%E5%9B%AD%E5%9C%B0%E5%9D%80' \
-d 'enter_type=1' \
-d 'enter_voucher_type=2' \
-d 'enter_voucher_value=%E5%85%B6%E4%BB%96%E5%85%A5%E5%9B%AD%E5%87%AD%E8%AF%81%E7%B1%BB%E5%9E%8B' \
-d 'extra_desc=%E8%A1%A5%E5%85%85%E8%AF%B4%E6%98%8E' \
-d 'fee_include=%E9%97%A8%E7%A5%A8%E8%B4%B9%E7%94%A8%E5%8C%85%E5%90%AB' \
-d 'out_rule_id=1234' \
-d 'out_rule_name=%E6%88%90%E4%BA%BA%E7%A5%A8%E8%A7%84%E5%88%99' \
-d 'out_scenic_id=111' \
-d 'refund_custom_rules=%7Btype%3A1%2Cdays%3A2%2Chours%3A16%2Cminutes%3A30%2Camount%3A20%2Cunit%3A1%7D%2C%7Btype%3A2%2Chours%3A12%2Cminutes%3A0%2Camount%3A50%2Cunit%3A1%7D%2C%7Btype%3A3%2Chours%3A11%2Cminutes%3A0%2Camount%3A60%2Cunit%3A1%7D%2C%7Btype%3A4%2Cdays%3A7%2Chours%3A23%2Cminutes%3A59%2Camount%3A80%2Cunit%3A1%7D%2C%7Btype%3A5%2Camount%3A10000%2Cunit%3A2%7D' \
-d 'refund_desc=%E9%80%80%E7%A5%A8%E6%8F%8F%E8%BF%B0' \
-d 'refund_type=1' \
-d 'rule_status=0' \
-d 'rule_type=0' \
-d 'ticket_change_adderss=%E6%8D%A2%E7%A5%A8%E5%9C%B0%E5%9D%80' \
-d 'visitor_infos=2%2C3%2C4' \
-d 'visitor_limit_able=1' \
-d 'visitor_limit_mode=1' \
-d 'visitor_limit_num=2' \
-d 'visitor_limit_type=0' \
-d 'visitor_require=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTicketRuleUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.extra_desc="补充说明"
req.ali_scenic_id=24498
req.visitor_limit_mode=1
req.enter_type=1
req.refund_desc="退票描述"
req.enter_voucher_type=2
req.visitor_limit_num=2
req.enter_address="景区入园地址"
req.visitor_require=1
req.fee_include="门票费用包含"
req.enter_voucher_value="其他入园凭证类型"
req.out_scenic_id="111"
req.ticket_change_adderss="换票地址"
req.out_rule_name="成人票规则"
req.rule_status=0
req.visitor_limit_able=1
req.refund_type=1
req.rule_type=0
req.out_rule_id="1234"
req.visitor_infos="2,3,4"
req.visitor_limit_type=0
req.auto_refund_support=1
req.refund_custom_rules="[{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}]"
try:
resp= req.getResponse(sessionkey)
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,"alitrip.ticket.rule.upload");
add_param(pRequest,"extra_desc","补充说明");
add_param(pRequest,"ali_scenic_id","24498");
add_param(pRequest,"visitor_limit_mode","1");
add_param(pRequest,"enter_type","1");
add_param(pRequest,"refund_desc","退票描述");
add_param(pRequest,"enter_voucher_type","2");
add_param(pRequest,"visitor_limit_num","2");
add_param(pRequest,"enter_address","景区入园地址");
add_param(pRequest,"visitor_require","1");
add_param(pRequest,"fee_include","门票费用包含");
add_param(pRequest,"enter_voucher_value","其他入园凭证类型");
add_param(pRequest,"out_scenic_id","111");
add_param(pRequest,"ticket_change_adderss","换票地址");
add_param(pRequest,"out_rule_name","成人票规则");
add_param(pRequest,"rule_status","0");
add_param(pRequest,"visitor_limit_able","1");
add_param(pRequest,"refund_type","1");
add_param(pRequest,"rule_type","0");
add_param(pRequest,"out_rule_id","1234");
add_param(pRequest,"visitor_infos","2,3,4");
add_param(pRequest,"visitor_limit_type","0");
add_param(pRequest,"auto_refund_support","1");
add_param(pRequest,"refund_custom_rules","{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}");
pResponse = top_execute(pClient,pRequest,sessionKey);
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('alitrip.ticket.rule.upload', {
'extra_desc':'补充说明',
'ali_scenic_id':'24498',
'visitor_limit_mode':'1',
'enter_type':'1',
'refund_desc':'退票描述',
'enter_voucher_type':'2',
'visitor_limit_num':'2',
'enter_address':'景区入园地址',
'visitor_require':'1',
'fee_include':'门票费用包含',
'enter_voucher_value':'其他入园凭证类型',
'out_scenic_id':'111',
'ticket_change_adderss':'换票地址',
'out_rule_name':'成人票规则',
'rule_status':'0',
'visitor_limit_able':'1',
'refund_type':'1',
'rule_type':'0',
'out_rule_id':'1234',
'visitor_infos':'2,3,4',
'visitor_limit_type':'0',
'auto_refund_support':'1',
'refund_custom_rules':'{type:1,days:2,hours:16,minutes:30,amount:20,unit:1},{type:2,hours:12,minutes:0,amount:50,unit:1},{type:3,hours:11,minutes:0,amount:60,unit:1},{type:4,days:7,hours:23,minutes:59,amount:80,unit:1},{type:5,amount:10000,unit:2}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})