TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelUpdateRequest req = new XhotelUpdateRequest();
req.setHid(100000L);
req.setName("北京饭店");
req.setUsedName("北京饭店");
req.setDomestic(0L);
req.setCountry("China");
req.setProvince(110000L);
req.setCity(110100L);
req.setDistrict(110101L);
req.setBusiness("aaa");
req.setAddress("西直门");
req.setLongitude("111.13");
req.setLatitude("111.1222");
req.setPositionType("G");
req.setTel("0086#010#12345678");
req.setExtend("空");
req.setOuterId("123123131");
req.setVendor("taobao");
req.setShid(123123L);
req.setStar("5");
req.setOpeningTime("2015-10-01");
req.setDecorateTime("2015-10-01");
req.setFloors("4-6层");
req.setRooms(20L);
req.setDescription("1");
req.setHotelFacilities("{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}");
req.setService("{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}");
req.setRoomFacilities("{\"bathtub\":\"true\",\"bathPub\":\"true\"}");
req.setPics("[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]");
req.setBrand("1");
req.setPostalCode("100000");
req.setHotelPolicies("{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}");
req.setBookingNotice("{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}");
req.setStatus("0");
req.setCreditCardTypes("1,2,3");
req.setOrbitTrack("{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
req.setNameE("Beijing hotel");
req.setTagJson("{}");
req.setAliNick("旺旺");
req.setSupplier("abc");
req.setSettlementCurrency("HKD");
req.setStandardBookingNotice("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}");
req.setStandardHotelFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}");
req.setStandardHotelService("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}");
req.setStandardRoomFacilities("废弃");
req.setStandardAmuseFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}");
req.setHotelType(0L);
req.setServiceType(0L);
req.setCoordinateSystem("WGS84");
req.setAddressEn("221 Moo 6, North Pattaya Soi 5, Chonburi");
req.setDescriptionEn("Hotel J Pattaya");
XhotelUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelUpdateRequest req = new XhotelUpdateRequest();
req.Hid = 100000L;
req.Name = "北京饭店";
req.UsedName = "北京饭店";
req.Domestic = 0L;
req.Country = "China";
req.Province = 110000L;
req.City = 110100L;
req.District = 110101L;
req.Business = "aaa";
req.Address = "西直门";
req.Longitude = "111.13";
req.Latitude = "111.1222";
req.PositionType = "G";
req.Tel = "0086#010#12345678";
req.Extend = "空";
req.OuterId = "123123131";
req.Vendor = "taobao";
req.Shid = 123123L;
req.Star = "5";
req.OpeningTime = "2015-10-01";
req.DecorateTime = "2015-10-01";
req.Floors = "4-6层";
req.Rooms = 20L;
req.Description = "1";
req.HotelFacilities = "{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}";
req.Service = "{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}";
req.RoomFacilities = "{\"bathtub\":\"true\",\"bathPub\":\"true\"}";
req.Pics = "[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]";
req.Brand = "1";
req.PostalCode = "100000";
req.HotelPolicies = "{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}";
req.BookingNotice = "{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}";
req.Status = "0";
req.CreditCardTypes = "1,2,3";
req.OrbitTrack = "{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }";
req.NameE = "Beijing hotel";
req.TagJson = "{}";
req.AliNick = "旺旺";
req.Supplier = "abc";
req.SettlementCurrency = "HKD";
req.StandardBookingNotice = "{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}";
req.StandardHotelFacilities = "{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}";
req.StandardHotelService = "{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}";
req.StandardRoomFacilities = "废弃";
req.StandardAmuseFacilities = "{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}";
req.HotelType = 0L;
req.ServiceType = 0L;
req.CoordinateSystem = "WGS84";
req.AddressEn = "221 Moo 6, North Pattaya Soi 5, Chonburi";
req.DescriptionEn = "Hotel J Pattaya";
XhotelUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelUpdateRequest;
$req->setHid("100000");
$req->setName("北京饭店");
$req->setUsedName("北京饭店");
$req->setDomestic("0");
$req->setCountry("China");
$req->setProvince("110000");
$req->setCity("110100");
$req->setDistrict("110101");
$req->setBusiness("aaa");
$req->setAddress("西直门");
$req->setLongitude("111.13");
$req->setLatitude("111.1222");
$req->setPositionType("G");
$req->setTel("0086#010#12345678");
$req->setExtend("空");
$req->setOuterId("123123131");
$req->setVendor("taobao");
$req->setShid("123123");
$req->setStar("5");
$req->setOpeningTime("2015-10-01");
$req->setDecorateTime("2015-10-01");
$req->setFloors("4-6层");
$req->setRooms("20");
$req->setDescription("1");
$req->setHotelFacilities("{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}");
$req->setService("{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}");
$req->setRoomFacilities("{\"bathtub\":\"true\",\"bathPub\":\"true\"}");
$req->setPics("[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]");
$req->setBrand("1");
$req->setPostalCode("100000");
$req->setHotelPolicies("{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}");
$req->setBookingNotice("{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}");
$req->setStatus("0");
$req->setCreditCardTypes("1,2,3");
$req->setOrbitTrack("{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
$req->setNameE("Beijing hotel");
$req->setTagJson("{}");
$req->setAliNick("旺旺");
$req->setSupplier("abc");
$req->setSettlementCurrency("HKD");
$req->setStandardBookingNotice("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}");
$req->setStandardHotelFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}");
$req->setStandardHotelService("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}");
$req->setStandardRoomFacilities("废弃");
$req->setStandardAmuseFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}");
$req->setHotelType("0");
$req->setServiceType("0");
$req->setCoordinateSystem("WGS84");
$req->setAddressEn("221 Moo 6, North Pattaya Soi 5, Chonburi");
$req->setDescriptionEn("Hotel J Pattaya");
$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.update' \
-d 'partner_id=apidoc' \
-d 'session=5b34b945-d712-4c8e-9c8b-38238b5d24c8' \
-d 'sign=4F9A1027247775D1AE4219ABA1FC805A' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+01%3A51%3A09' \
-d 'v=2.0' \
-d 'address=%E8%A5%BF%E7%9B%B4%E9%97%A8' \
-d 'address_en=221+Moo+6%2C+North+Pattaya+Soi+5%2C+Chonburi' \
-d 'ali_nick=%E6%97%BA%E6%97%BA' \
-d 'booking_notice=%7B%5C%22hotelInMountaintop%5C%22%3A1%2C%5C%22needBoat%5C%22%3A1%2C%5C%22hotelInScenicSpot%5C%22%3A1%2C%5C%22extraBed%5C%22%3A%5C%22%E5%8A%A0%E5%BA%8A%E6%94%B6%E8%B4%B9xx%E5%85%83%5C%22%2C%5C%22extraCharge%5C%22%3A%5C%22%5C%22%2C%5C%22arrivalTime%5C%22%3A%5C%22%E5%85%A5%E4%BD%8F%E6%97%A518%E7%82%B9%E5%89%8D%5C%22%2C%5C%22extend%5C%22%3A%5C%22%5C%22%7D' \
-d 'brand=1' \
-d 'business=aaa' \
-d 'city=110100' \
-d 'coordinate_system=WGS84' \
-d 'country=China' \
-d 'credit_card_types=1%2C2%2C3' \
-d 'decorate_time=2015-10-01' \
-d 'description=1' \
-d 'description_en=Hotel+J+Pattaya' \
-d 'district=110101' \
-d 'domestic=0' \
-d 'extend=%E7%A9%BA' \
-d 'floors=4-6%E5%B1%82' \
-d 'hid=100000' \
-d 'hotel_facilities=%7B%5C%22free+Wi-Fi+in+all+rooms%5C%22%3A%5C%22true%5C%22%2C%5C%22massage%5C%22%3A%5C%22true%5C%22%2C%5C%22meetingRoom%5C%22%3A%5C%22true%5C%22%7D' \
-d 'hotel_policies=%7B%5C%22children_age_from%5C%22%3A%5C%222%5C%22%2C%5C%22children_age_to%5C%22%3A%5C%223%5C%22%2C%5C%22children_stay_free%5C%22%3A%5C%22True%5C%22%2C%5C%22infant_age%5C%22%3A%5C%221%5C%22%2C%5C%22min_guest_age%5C%22%3A%5C%224%5C%22%7D' \
-d 'hotel_type=0' \
-d 'latitude=111.1222' \
-d 'longitude=111.13' \
-d 'name=%E5%8C%97%E4%BA%AC%E9%A5%AD%E5%BA%97' \
-d 'name_e=Beijing+hotel' \
-d 'opening_time=2015-10-01' \
-d 'orbit_track=%7B+%09%5C%22orbitTrack%5C%22%3A%5B+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E9%A3%9E%E7%8C%AA%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%9B%B4%E8%BF%9E%5C%22++%09%09%7D%2C+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%8E%BB%E5%93%AA%E5%84%BF%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%9B%B4%E8%BF%9E%5C%22+%09%09%7D+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%A6%82%E5%AE%B6%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%94%B5%E8%AF%9D%5C%22+%09%09%7D%2C+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%A6%82%E5%AE%B6%E8%A5%BF%E6%B9%96%E5%BA%97%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E4%BA%BA%E5%B7%A5%5C%22+%09%09%7D+%09%5D+%7D' \
-d 'outer_id=123123131' \
-d 'pics=%7B%22url%22%3A%22http%3A%2F%2F123.jpg%22%2C%22ismain%22%3A%22false%22%2C%22type%22%3A%22%E5%A4%A7%E5%A0%82%22%2C%22attribute%22%3A%22%E6%99%AE%E9%80%9A%E5%9B%BE%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2F456.jpg%22%2C%22ismain%22%3A%22true%22%2C%22type%22%3A%22%E5%85%AC%E5%85%B1%E5%8C%BA%E5%9F%9F%22%2C%22attribute%22%3A%22%E5%85%A8%E6%99%AF%E5%9B%BE%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2F789.jpg%22%2C%22ismain%22%3A%22false%22%2C%22type%22%3A%22%E5%A4%A7%E5%A0%82%22%2C%22attribute%22%3A%22%E6%99%AE%E9%80%9A%E5%9B%BE%22%7D' \
-d 'position_type=G' \
-d 'postal_code=100000' \
-d 'province=110000' \
-d 'room_facilities=%7B%5C%22bathtub%5C%22%3A%5C%22true%5C%22%2C%5C%22bathPub%5C%22%3A%5C%22true%5C%22%7D' \
-d 'rooms=20' \
-d 'service=%7B%5C%22receiveForeignGuests%5C%22%3A%5C%22true%5C%22%2C%5C%22morningCall%5C%22%3A%5C%22true%5C%22%2C%5C%22breakfast%5C%22%3A%5C%22true%5C%22%7D' \
-d 'service_type=0' \
-d 'settlement_currency=HKD' \
-d 'shid=123123' \
-d 'standard_amuse_facilities=%7B%5C%22dataVersion%5C%22%3A%5C%222.0.0%5C%22%2C%5C%22facilityList%5C%22%3A%5B%7B%5C%2275%5C%22%3Atrue%7D%5D%7D' \
-d 'standard_booking_notice=%7B%5C%22dataVersion%5C%22%3A%5C%222.0.0%5C%22%2C%5C%22facilityList%5C%22%3A%5B%7B%5C%22500%5C%22%3Atrue%2C%5C%22free%5C%22%3Atrue%7D%5D%7D' \
-d 'standard_hotel_facilities=%7B%5C%22dataVersion%5C%22%3A%5C%222.0.0%5C%22%2C%5C%22facilityList%5C%22%3A%5B%7B%5C%2251%5C%22%3Atrue%2C%5C%22option%5C%22%3A%5C%222%5C%22%7D%5D%7D' \
-d 'standard_hotel_service=%7B%5C%22dataVersion%5C%22%3A%5C%222.0.0%5C%22%2C%5C%22facilityList%5C%22%3A%5B%7B%5C%2212%5C%22%3Atrue%2C%5C%22free%5C%22%3Atrue%7D%5D%7D' \
-d 'standard_room_facilities=%E5%BA%9F%E5%BC%83' \
-d 'star=5' \
-d 'status=0' \
-d 'supplier=abc' \
-d 'tag_json=%7B%7D' \
-d 'tel=0086%23010%2312345678' \
-d 'used_name=%E5%8C%97%E4%BA%AC%E9%A5%AD%E5%BA%97' \
-d 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.hid=100000
req.name="北京饭店"
req.used_name="北京饭店"
req.domestic=0
req.country="China"
req.province=110000
req.city=110100
req.district=110101
req.business="aaa"
req.address="西直门"
req.longitude="111.13"
req.latitude="111.1222"
req.position_type="G"
req.tel="0086#010#12345678"
req.extend="空"
req.outer_id="123123131"
req.vendor="taobao"
req.shid=123123
req.star="5"
req.opening_time="2015-10-01"
req.decorate_time="2015-10-01"
req.floors="4-6层"
req.rooms=20
req.description="1"
req.hotel_facilities="{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}"
req.service="{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}"
req.room_facilities="{\"bathtub\":\"true\",\"bathPub\":\"true\"}"
req.pics="[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]"
req.brand="1"
req.postal_code="100000"
req.hotel_policies="{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}"
req.booking_notice="{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}"
req.status="0"
req.credit_card_types="1,2,3"
req.orbit_track="{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }"
req.name_e="Beijing hotel"
req.tag_json="{}"
req.ali_nick="旺旺"
req.supplier="abc"
req.settlement_currency="HKD"
req.standard_booking_notice="{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}"
req.standard_hotel_facilities="{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}"
req.standard_hotel_service="{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}"
req.standard_room_facilities="废弃"
req.standard_amuse_facilities="{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}"
req.hotel_type=0
req.service_type=0
req.coordinate_system="WGS84"
req.address_en="221 Moo 6, North Pattaya Soi 5, Chonburi"
req.description_en="Hotel J Pattaya"
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.update");
add_param(pRequest,"hid","100000");
add_param(pRequest,"name","北京饭店");
add_param(pRequest,"used_name","北京饭店");
add_param(pRequest,"domestic","0");
add_param(pRequest,"country","China");
add_param(pRequest,"province","110000");
add_param(pRequest,"city","110100");
add_param(pRequest,"district","110101");
add_param(pRequest,"business","aaa");
add_param(pRequest,"address","西直门");
add_param(pRequest,"longitude","111.13");
add_param(pRequest,"latitude","111.1222");
add_param(pRequest,"position_type","G");
add_param(pRequest,"tel","0086#010#12345678");
add_param(pRequest,"extend","空");
add_param(pRequest,"outer_id","123123131");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"shid","123123");
add_param(pRequest,"star","5");
add_param(pRequest,"opening_time","2015-10-01");
add_param(pRequest,"decorate_time","2015-10-01");
add_param(pRequest,"floors","4-6层");
add_param(pRequest,"rooms","20");
add_param(pRequest,"description","1");
add_param(pRequest,"hotel_facilities","{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}");
add_param(pRequest,"service","{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}");
add_param(pRequest,"room_facilities","{\"bathtub\":\"true\",\"bathPub\":\"true\"}");
add_param(pRequest,"pics","{"url":"http://123.jpg","ismain":"false","type":"大堂","attribute":"普通图"},{"url":"http://456.jpg","ismain":"true","type":"公共区域","attribute":"全景图"},{"url":"http://789.jpg","ismain":"false","type":"大堂","attribute":"普通图"}");
add_param(pRequest,"brand","1");
add_param(pRequest,"postal_code","100000");
add_param(pRequest,"hotel_policies","{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}");
add_param(pRequest,"booking_notice","{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}");
add_param(pRequest,"status","0");
add_param(pRequest,"credit_card_types","1,2,3");
add_param(pRequest,"orbit_track","{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
add_param(pRequest,"name_e","Beijing hotel");
add_param(pRequest,"tag_json","{}");
add_param(pRequest,"ali_nick","旺旺");
add_param(pRequest,"supplier","abc");
add_param(pRequest,"settlement_currency","HKD");
add_param(pRequest,"standard_booking_notice","{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}");
add_param(pRequest,"standard_hotel_facilities","{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}");
add_param(pRequest,"standard_hotel_service","{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}");
add_param(pRequest,"standard_room_facilities","废弃");
add_param(pRequest,"standard_amuse_facilities","{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}");
add_param(pRequest,"hotel_type","0");
add_param(pRequest,"service_type","0");
add_param(pRequest,"coordinate_system","WGS84");
add_param(pRequest,"address_en","221 Moo 6, North Pattaya Soi 5, Chonburi");
add_param(pRequest,"description_en","Hotel J Pattaya");
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.update', {
'hid':'100000',
'name':'北京饭店',
'used_name':'北京饭店',
'domestic':'0',
'country':'China',
'province':'110000',
'city':'110100',
'district':'110101',
'business':'aaa',
'address':'西直门',
'longitude':'111.13',
'latitude':'111.1222',
'position_type':'G',
'tel':'0086#010#12345678',
'extend':'空',
'outer_id':'123123131',
'vendor':'taobao',
'shid':'123123',
'star':'5',
'opening_time':'2015-10-01',
'decorate_time':'2015-10-01',
'floors':'4-6层',
'rooms':'20',
'description':'1',
'hotel_facilities':'{\"free Wi-Fi in all rooms\":\"true\",\"massage\":\"true\",\"meetingRoom\":\"true\"}',
'service':'{\"receiveForeignGuests\":\"true\",\"morningCall\":\"true\",\"breakfast\":\"true\"}',
'room_facilities':'{\"bathtub\":\"true\",\"bathPub\":\"true\"}',
'pics':'{"url":"http://123.jpg","ismain":"false","type":"大堂","attribute":"普通图"},{"url":"http://456.jpg","ismain":"true","type":"公共区域","attribute":"全景图"},{"url":"http://789.jpg","ismain":"false","type":"大堂","attribute":"普通图"}',
'brand':'1',
'postal_code':'100000',
'hotel_policies':'{\"children_age_from\":\"2\",\"children_age_to\":\"3\",\"children_stay_free\":\"True\",\"infant_age\":\"1\",\"min_guest_age\":\"4\"}',
'booking_notice':'{\"hotelInMountaintop\":1,\"needBoat\":1,\"hotelInScenicSpot\":1,\"extraBed\":\"加床收费xx元\",\"extraCharge\":\"\",\"arrivalTime\":\"入住日18点前\",\"extend\":\"\"}',
'status':'0',
'credit_card_types':'1,2,3',
'orbit_track':'{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }',
'name_e':'Beijing hotel',
'tag_json':'{}',
'ali_nick':'旺旺',
'supplier':'abc',
'settlement_currency':'HKD',
'standard_booking_notice':'{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"free\":true}]}',
'standard_hotel_facilities':'{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"51\":true,\"option\":\"2\"}]}',
'standard_hotel_service':'{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"12\":true,\"free\":true}]}',
'standard_room_facilities':'废弃',
'standard_amuse_facilities':'{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"75\":true}]}',
'hotel_type':'0',
'service_type':'0',
'coordinate_system':'WGS84',
'address_en':'221 Moo 6, North Pattaya Soi 5, Chonburi',
'description_en':'Hotel J Pattaya'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})