TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TbkScRecMaterialRequest req = new TbkScRecMaterialRequest();
req.setPageSize(20L);
req.setPageNo(1L);
req.setAdzoneId(123L);
req.setMaterialId(123L);
req.setSiteId(111L);
req.setItemId("33243");
req.setPageUrl("https://www.xxx.com");
req.setExternalType(1L);
req.setExternalId("123");
req.setUserSid("123");
req.setProfitRatio("127");
req.setClientIp("127.0.0.1");
TbkScRecMaterialResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TbkScRecMaterialRequest req = new TbkScRecMaterialRequest();
req.PageSize = 20L;
req.PageNo = 1L;
req.AdzoneId = 123L;
req.MaterialId = 123L;
req.SiteId = 111L;
req.ItemId = "33243";
req.PageUrl = "https://www.xxx.com";
req.ExternalType = 1L;
req.ExternalId = "123";
req.UserSid = "123";
req.ProfitRatio = "127";
req.ClientIp = "127.0.0.1";
TbkScRecMaterialResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TbkScRecMaterialRequest;
$req->setPageSize("20");
$req->setPageNo("1");
$req->setAdzoneId("123");
$req->setMaterialId("123");
$req->setSiteId("111");
$req->setItemId("33243");
$req->setPageUrl("https://www.xxx.com");
$req->setExternalType("1");
$req->setExternalId("123");
$req->setUserSid("123");
$req->setProfitRatio("127");
$req->setClientIp("127.0.0.1");
$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=taobao.tbk.sc.rec.material' \
-d 'partner_id=apidoc' \
-d 'session=3e758dbc-5cf4-4637-b6a3-5570b544cfd4' \
-d 'sign=6F713DA3BADB301F92F8CC1617685CF1' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-16+00%3A51%3A55' \
-d 'v=2.0' \
-d 'adzone_id=123' \
-d 'client_ip=127.0.0.1' \
-d 'external_id=123' \
-d 'external_type=1' \
-d 'item_id=33243' \
-d 'material_id=123' \
-d 'page_no=1' \
-d 'page_size=20' \
-d 'page_url=https%3A%2F%2Fwww.xxx.com' \
-d 'profit_ratio=127' \
-d 'site_id=111' \
-d 'user_sid=123'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TbkScRecMaterialRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.page_size=20
req.page_no=1
req.adzone_id=123
req.material_id=123
req.site_id=111
req.item_id="33243"
req.page_url="https://www.xxx.com"
req.external_type=1
req.external_id="123"
req.user_sid="123"
req.profit_ratio="127"
req.client_ip="127.0.0.1"
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,"taobao.tbk.sc.rec.material");
add_param(pRequest,"page_size","20");
add_param(pRequest,"page_no","1");
add_param(pRequest,"adzone_id","123");
add_param(pRequest,"material_id","123");
add_param(pRequest,"site_id","111");
add_param(pRequest,"item_id","33243");
add_param(pRequest,"page_url","https://www.xxx.com");
add_param(pRequest,"external_type","1");
add_param(pRequest,"external_id","123");
add_param(pRequest,"user_sid","123");
add_param(pRequest,"profit_ratio","127");
add_param(pRequest,"client_ip","127.0.0.1");
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('taobao.tbk.sc.rec.material', {
'page_size':'20',
'page_no':'1',
'adzone_id':'123',
'material_id':'123',
'site_id':'111',
'item_id':'33243',
'page_url':'https://www.xxx.com',
'external_type':'1',
'external_id':'123',
'user_sid':'123',
'profit_ratio':'127',
'client_ip':'127.0.0.1'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})