TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TbkCouponConvertRequest req = new TbkCouponConvertRequest();
req.setAdzoneId(123L);
req.setItemId("123");
req.setPlatform(1L);
req.setRelationId("12345");
req.setSpecialId("12345");
req.setExternalId("12345");
req.setXid("abcdefg");
req.setUcrowdId(1L);
req.setGetTopnRate(0L);
req.setMiniProgramLink(0L);
req.setBizSceneId("1");
req.setPromotionType("2");
req.setManageItemPubId(1L);
req.setSkuId(1234567L);
TbkCouponConvertResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TbkCouponConvertRequest req = new TbkCouponConvertRequest();
req.AdzoneId = 123L;
req.ItemId = "123";
req.Platform = 1L;
req.RelationId = "12345";
req.SpecialId = "12345";
req.ExternalId = "12345";
req.Xid = "abcdefg";
req.UcrowdId = 1L;
req.GetTopnRate = 0L;
req.MiniProgramLink = 0L;
req.BizSceneId = "1";
req.PromotionType = "2";
req.ManageItemPubId = 1L;
req.SkuId = 1234567L;
TbkCouponConvertResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TbkCouponConvertRequest;
$req->setAdzoneId("123");
$req->setItemId("123");
$req->setPlatform("1");
$req->setRelationId("12345");
$req->setSpecialId("12345");
$req->setExternalId("12345");
$req->setXid("abcdefg");
$req->setUcrowdId("1");
$req->setGetTopnRate("0");
$req->setMiniProgramLink("0");
$req->setBizSceneId("1");
$req->setPromotionType("2");
$req->setManageItemPubId("1");
$req->setSkuId("1234567");
$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=taobao.tbk.coupon.convert' \
-d 'partner_id=apidoc' \
-d 'sign=D70C65D0649E23DD97C5A7201F935BF5' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-18+11%3A22%3A49' \
-d 'v=2.0' \
-d 'adzone_id=123' \
-d 'biz_scene_id=1' \
-d 'external_id=12345' \
-d 'get_topn_rate=0' \
-d 'item_id=123' \
-d 'manage_item_pub_id=1' \
-d 'mini_program_link=0' \
-d 'platform=1' \
-d 'promotion_type=2' \
-d 'relation_id=12345' \
-d 'sku_id=1234567' \
-d 'special_id=12345' \
-d 'ucrowd_id=1' \
-d 'xid=abcdefg'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TbkCouponConvertRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.adzone_id=123
req.item_id="123"
req.platform=1
req.relation_id="12345"
req.special_id="12345"
req.external_id="12345"
req.xid="abcdefg"
req.ucrowd_id=1
req.get_topn_rate=0
req.mini_program_link=0
req.biz_scene_id="1"
req.promotion_type="2"
req.manage_item_pub_id=1
req.sku_id=1234567
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,"taobao.tbk.coupon.convert");
add_param(pRequest,"adzone_id","123");
add_param(pRequest,"item_id","123");
add_param(pRequest,"platform","1");
add_param(pRequest,"relation_id","12345");
add_param(pRequest,"special_id","12345");
add_param(pRequest,"external_id","12345");
add_param(pRequest,"xid","abcdefg");
add_param(pRequest,"ucrowd_id","1");
add_param(pRequest,"get_topn_rate","0");
add_param(pRequest,"mini_program_link","0");
add_param(pRequest,"biz_scene_id","1");
add_param(pRequest,"promotion_type","2");
add_param(pRequest,"manage_item_pub_id","1");
add_param(pRequest,"sku_id","1234567");
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('taobao.tbk.coupon.convert', {
'adzone_id':'123',
'item_id':'123',
'platform':'1',
'relation_id':'12345',
'special_id':'12345',
'external_id':'12345',
'xid':'abcdefg',
'ucrowd_id':'1',
'get_topn_rate':'0',
'mini_program_link':'0',
'biz_scene_id':'1',
'promotion_type':'2',
'manage_item_pub_id':'1',
'sku_id':'1234567'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})