TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TfxProductSearchRequest req = new TfxProductSearchRequest();
TfxProductSearchRequest.ISVProductSearchRequest obj1 = new TfxProductSearchRequest.ISVProductSearchRequest();
obj1.setTitle("奶粉");
TfxProductSearchRequest.PageParam obj2 = new TfxProductSearchRequest.PageParam();
obj2.setPageNo(1L);
obj2.setPageSize(10L);
obj1.setPageParam(obj2);
obj1.setTags("gj_zx");
TfxProductSearchRequest.PriceRange obj3 = new TfxProductSearchRequest.PriceRange();
obj3.setHigh("200.00");
obj3.setLow("100.00");
obj1.setCostPriceRange(obj3);
TfxProductSearchRequest.Order obj4 = new TfxProductSearchRequest.Order();
obj4.setOrderType("desc");
obj4.setOrderBy("costPrice");
obj1.setOrder(obj4);
req.setIsvProductSearchRequest(obj1);
TfxProductSearchResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TfxProductSearchRequest req = new TfxProductSearchRequest();
TfxProductSearchRequest.ISVProductSearchRequestDomain obj1 = new TfxProductSearchRequest.ISVProductSearchRequestDomain();
obj1.Title = "奶粉";
TfxProductSearchRequest.PageParamDomain obj2 = new TfxProductSearchRequest.PageParamDomain();
obj2.PageNo = 1L;
obj2.PageSize = 10L;
obj1.PageParam= obj2;
obj1.Tags = "gj_zx";
TfxProductSearchRequest.PriceRangeDomain obj3 = new TfxProductSearchRequest.PriceRangeDomain();
obj3.High = "200.00";
obj3.Low = "100.00";
obj1.CostPriceRange= obj3;
TfxProductSearchRequest.OrderDomain obj4 = new TfxProductSearchRequest.OrderDomain();
obj4.OrderType = "desc";
obj4.OrderBy = "costPrice";
obj1.Order= obj4;
req.IsvProductSearchRequest_ = obj1;
TfxProductSearchResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TfxProductSearchRequest;
$isv_product_search_request = new ISVProductSearchRequest;
$isv_product_search_request->title="奶粉";
$page_param = new PageParam;
$page_param->page_no="1";
$page_param->page_size="10";
$isv_product_search_request->page_param = $page_param;
$isv_product_search_request->tags="gj_zx";
$cost_price_range = new PriceRange;
$cost_price_range->high="200.00";
$cost_price_range->low="100.00";
$isv_product_search_request->cost_price_range = $cost_price_range;
$order = new Order;
$order->order_type="desc";
$order->order_by="costPrice";
$isv_product_search_request->order = $order;
$req->setIsvProductSearchRequest(json_encode($isv_product_search_request));
$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.tfx.product.search' \
-d 'partner_id=apidoc' \
-d 'session=bcc54952-9924-4126-ad18-d9f9d5240f20' \
-d 'sign=8C7E6D98D50C07DDC6D91B885D8BD934' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+17%3A08%3A21' \
-d 'v=2.0' \
-d 'isv_product_search_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TfxProductSearchRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.isv_product_search_request="数据结构示例JSON格式"
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.tfx.product.search");
add_param(pRequest,"isv_product_search_request","数据结构JSON示例");
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.tfx.product.search', {
'isv_product_search_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})