TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelItemElementManageRequest req = new AlitripTravelItemElementManageRequest();
req.setOperation(1L);
req.setOuterId("0001");
req.setElementType(2L);
req.setName("香格里拉大酒店");
req.setCity("杭州");
req.setType("标准间");
req.setDesc("其他资源 描述");
AlitripTravelItemElementManageResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelItemElementManageRequest req = new AlitripTravelItemElementManageRequest();
req.Operation = 1L;
req.OuterId = "0001";
req.ElementType = 2L;
req.Name = "香格里拉大酒店";
req.City = "杭州";
req.Type = "标准间";
req.Desc = "其他资源 描述";
AlitripTravelItemElementManageResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelItemElementManageRequest;
$req->setOperation("1");
$req->setOuterId("0001");
$req->setElementType("2");
$req->setName("香格里拉大酒店");
$req->setCity("杭州");
$req->setType("标准间");
$req->setDesc("其他资源 描述");
$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.alitrip.travel.item.element.manage' \
-d 'partner_id=apidoc' \
-d 'session=251b39e9-d137-42da-9308-e9b6f8f72223' \
-d 'sign=AAC01F4F9F2AABA0E5E822B54944E84F' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+21%3A39%3A15' \
-d 'v=2.0' \
-d 'city=%E6%9D%AD%E5%B7%9E' \
-d 'desc=%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90+%E6%8F%8F%E8%BF%B0' \
-d 'element_type=2' \
-d 'name=%E9%A6%99%E6%A0%BC%E9%87%8C%E6%8B%89%E5%A4%A7%E9%85%92%E5%BA%97' \
-d 'operation=1' \
-d 'outer_id=0001' \
-d 'type=%E6%A0%87%E5%87%86%E9%97%B4'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelItemElementManageRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.operation=1
req.outer_id="0001"
req.element_type=2
req.name="香格里拉大酒店"
req.city="杭州"
req.type="标准间"
req.desc="其他资源 描述"
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.alitrip.travel.item.element.manage");
add_param(pRequest,"operation","1");
add_param(pRequest,"outer_id","0001");
add_param(pRequest,"element_type","2");
add_param(pRequest,"name","香格里拉大酒店");
add_param(pRequest,"city","杭州");
add_param(pRequest,"type","标准间");
add_param(pRequest,"desc","其他资源 描述");
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.alitrip.travel.item.element.manage', {
'operation':'1',
'outer_id':'0001',
'element_type':'2',
'name':'香格里拉大酒店',
'city':'杭州',
'type':'标准间',
'desc':'其他资源 描述'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})