TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelBnbreviewAddRequest req = new XhotelBnbreviewAddRequest();
req.setCheckInTime("2022-02-02");
req.setSource(38L);
XhotelBnbreviewAddRequest.ReviewPicInfo obj1 = new XhotelBnbreviewAddRequest.ReviewPicInfo();
obj1.setUrl("http://xxx.xx");
req.setPicInfoList(obj1);
req.setRid(1L);
req.setGmtCreate(StringUtils.parseDateTime("2022-02-02 12:12:12"));
req.setContent("无");
req.setUserNick("无");
req.setOuterId(1L);
XhotelBnbreviewAddRequest.ReviewDetailInfo obj2 = new XhotelBnbreviewAddRequest.ReviewDetailInfo();
obj2.setScore("9.0");
obj2.setDimensionId(1L);
req.setScoreDetail(obj2);
req.setTotalScore("9.0");
XhotelBnbreviewAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelBnbreviewAddRequest req = new XhotelBnbreviewAddRequest();
req.CheckInTime = "2022-02-02";
req.Source = 38L;
XhotelBnbreviewAddRequest.ReviewPicInfoDomain obj1 = new XhotelBnbreviewAddRequest.ReviewPicInfoDomain();
obj1.Url = "http://xxx.xx";
req.PicInfoList_ = obj1;
req.Rid = 1L;
req.GmtCreate = DateTime.Parse("2022-02-02 12:12:12");
req.Content = "无";
req.UserNick = "无";
req.OuterId = 1L;
XhotelBnbreviewAddRequest.ReviewDetailInfoDomain obj2 = new XhotelBnbreviewAddRequest.ReviewDetailInfoDomain();
obj2.Score = "9.0";
obj2.DimensionId = 1L;
req.ScoreDetail_ = obj2;
req.TotalScore = "9.0";
XhotelBnbreviewAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelBnbreviewAddRequest;
$req->setCheckInTime("2022-02-02");
$req->setSource("38");
$pic_info_list = new ReviewPicInfo;
$pic_info_list->url="http://xxx.xx";
$req->setPicInfoList(json_encode($pic_info_list));
$req->setRid("1");
$req->setGmtCreate("2022-02-02 12:12:12");
$req->setContent("无");
$req->setUserNick("无");
$req->setOuterId("1");
$score_detail = new ReviewDetailInfo;
$score_detail->score="9.0";
$score_detail->dimension_id="1";
$req->setScoreDetail(json_encode($score_detail));
$req->setTotalScore("9.0");
$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.xhotel.bnbreview.add' \
-d 'partner_id=apidoc' \
-d 'session=26e0de2b-2333-4ded-806d-f59c9bbbc1c7' \
-d 'sign=E1AD1E7E8A885C309FA93E1EE1C8DA95' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A58%3A39' \
-d 'v=2.0' \
-d 'check_in_time=2022-02-02' \
-d 'content=%E6%97%A0' \
-d 'gmt_create=2022-02-02+12%3A12%3A12' \
-d 'outer_id=1' \
-d 'pic_info_list=%E6%97%A0' \
-d 'rid=1' \
-d 'score_detail=%E6%97%A0' \
-d 'source=38' \
-d 'total_score=9.0' \
-d 'user_nick=%E6%97%A0'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelBnbreviewAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.check_in_time="2022-02-02"
req.source=38
req.pic_info_list="无"
req.rid=1
req.gmt_create="2022-02-02 12:12:12"
req.content="无"
req.user_nick="无"
req.outer_id=1
req.score_detail="无"
req.total_score="9.0"
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.xhotel.bnbreview.add");
add_param(pRequest,"check_in_time","2022-02-02");
add_param(pRequest,"source","38");
add_param(pRequest,"pic_info_list","数据结构JSON示例");
add_param(pRequest,"rid","1");
add_param(pRequest,"gmt_create","2022-02-02 12:12:12");
add_param(pRequest,"content","无");
add_param(pRequest,"user_nick","无");
add_param(pRequest,"outer_id","1");
add_param(pRequest,"score_detail","数据结构JSON示例");
add_param(pRequest,"total_score","9.0");
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.xhotel.bnbreview.add', {
'check_in_time':'2022-02-02',
'source':'38',
'pic_info_list':'数据结构JSON示例',
'rid':'1',
'gmt_create':'2022-02-02 12:12:12',
'content':'无',
'user_nick':'无',
'outer_id':'1',
'score_detail':'数据结构JSON示例',
'total_score':'9.0'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})