感谢您的反馈!
import com.taobao.api.DefaultTaobaoClient; import com.taobao.api.TaobaoClient; import com.taobao.api.request.XhotelUpdateRequest; import com.taobao.api.response.XhotelUpdateResponse; public class AlitripHotel { public static void main(String[] args) { public String serverUrl = ""; public String appKey = ""; public String appSecret = ""; public String sessionKey = ""; 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.setOuterId("123123131"); req.setVendor("taobao"); req.setPostalCode("100000"); req.setStatus("0"); req.setNameE("Beijing hotel"); req.setTagJson("{}"); req.setAliNick("旺旺"); req.setSupplier("abc"); XhotelUpdateResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); } }
using System; using Top.Api; using Top.Api.Request; using Top.Api.Response; namespace ApiTest { public class Program { public static void Main(string[] args) { string serverUrl = ""; string appKey = ""; string appSecret = ""; string sessionKey = ""; ITopClient client = new DefaultTopClient(serverUrl, appKey, appSecret, "json"); 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.Rooms = 20L; req.Description = "1"; req.NameE = "Beijing hotel"; req.Supplier = "abc"; 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); } } }
<?php header("Content-type: text/html; charset=utf-8"); include "TopSdk.php"; $c = new TopClient; $c->appkey = ""; $c->secretKey = ""; $sessionkey= ""; $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->setStar("5"); $req->setNameE("Beijing hotel"); $req->setAliNick("旺旺"); $req->setSupplier("abc"); $resp = $c->execute($req, $sessionKey); echo "api result:"; print_r($rsp); ?>