TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
GrowthReachingSuggestionQueryRequest req = new GrowthReachingSuggestionQueryRequest();
GrowthReachingSuggestionQueryRequest.SuggestionContextParam obj1 = new GrowthReachingSuggestionQueryRequest.SuggestionContextParam();
GrowthReachingSuggestionQueryRequest.DeviceIdParam obj2 = new GrowthReachingSuggestionQueryRequest.DeviceIdParam();
obj2.setOs("Android");
obj2.setIsMd5(false);
obj2.setType("oaid");
obj2.setValue("1fe9a970-efbb-29e0-0bdd-f5dbbf751ab5");
obj1.setDeviceId(obj2);
obj1.setSiteId("testSite");
obj1.setWeather("1");
obj1.setRegion("杭州");
obj1.setSex("m");
obj1.setAge(18L);
GrowthReachingSuggestionQueryRequest.Temperature obj3 = new GrowthReachingSuggestionQueryRequest.Temperature();
obj3.setHighest("26");
obj3.setLowest("18");
obj1.setTemperature(obj3);
obj1.setExtra("isStressTest:false");
req.setSuggestionContext(obj1);
req.setWantedSize(1L);
GrowthReachingSuggestionQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
GrowthReachingSuggestionQueryRequest req = new GrowthReachingSuggestionQueryRequest();
GrowthReachingSuggestionQueryRequest.SuggestionContextParamDomain obj1 = new GrowthReachingSuggestionQueryRequest.SuggestionContextParamDomain();
GrowthReachingSuggestionQueryRequest.DeviceIdParamDomain obj2 = new GrowthReachingSuggestionQueryRequest.DeviceIdParamDomain();
obj2.Os = "Android";
obj2.IsMd5 = false;
obj2.Type = "oaid";
obj2.Value = "1fe9a970-efbb-29e0-0bdd-f5dbbf751ab5";
obj1.DeviceId= obj2;
obj1.SiteId = "testSite";
obj1.Weather = "1";
obj1.Region = "杭州";
obj1.Sex = "m";
obj1.Age = 18L;
GrowthReachingSuggestionQueryRequest.TemperatureDomain obj3 = new GrowthReachingSuggestionQueryRequest.TemperatureDomain();
obj3.Highest = "26";
obj3.Lowest = "18";
obj1.Temperature= obj3;
obj1.Extra = "isStressTest:false";
req.SuggestionContext_ = obj1;
req.WantedSize = 1L;
GrowthReachingSuggestionQueryResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new GrowthReachingSuggestionQueryRequest;
$suggestion_context = new SuggestionContextParam;
$device_id = new DeviceIdParam;
$device_id->os="Android";
$device_id->is_md5="false";
$device_id->type="oaid";
$device_id->value="1fe9a970-efbb-29e0-0bdd-f5dbbf751ab5";
$suggestion_context->device_id = $device_id;
$suggestion_context->site_id="testSite";
$suggestion_context->weather="1";
$suggestion_context->region="杭州";
$suggestion_context->sex="m";
$suggestion_context->age="18";
$temperature = new Temperature;
$temperature->highest="26";
$temperature->lowest="18";
$suggestion_context->temperature = $temperature;
$suggestion_context->extra="isStressTest:false";
$req->setSuggestionContext(json_encode($suggestion_context));
$req->setWantedSize("1");
$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.growth.reaching.suggestion.query' \
-d 'partner_id=apidoc' \
-d 'sign=F4BA683D768AFE820FC17BDB9F6533EC' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-06-03+06%3A05%3A59' \
-d 'v=2.0' \
-d 'suggestion_context=null' \
-d 'wanted_size=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.GrowthReachingSuggestionQueryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.suggestion_context="数据结构示例JSON格式"
req.wanted_size=1
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.growth.reaching.suggestion.query");
add_param(pRequest,"suggestion_context","数据结构JSON示例");
add_param(pRequest,"wanted_size","1");
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.growth.reaching.suggestion.query', {
'suggestion_context':'数据结构JSON示例',
'wanted_size':'1'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})