淘宝交易API调用成功 含session key获取

 //获取appsession步骤
            //1.地址 http://container.open.taobao.com/container?appkey=125449XX&encode=utf-8
            //2.session key将返回到回调地址的top_session参数中
            string url = "http://gw.api.taobao.com/router/rest";
            string appkey = "125449XX";
            string appsecret = "adb1ac06c7667b8bc885e3690b07XXXX";
            string appsession = "610152292d4d8a6669e359d3dae86817cfdc9e4b2d714b6114XXXXXX";
            ITopClient myclient = new DefaultTopClient(url, appkey, appsecret);//实例化ITopClient类

            TradeFullinfoGetRequest request = new TradeFullinfoGetRequest();
            request.Fields = "buyer_nick";
            request.Tid = 131591511522928;

            TradeFullinfoGetResponse response = myclient.Execute(request, appsession);//执行API请求并将该类转换为response对象

            MessageBox.Show(response.Trade.BuyerNick);

这件就可以得到订单编号  131591511522928 的买家名
淘宝交易API调用成功 含session key获取_第1张图片
 
 
 

你可能感兴趣的:(淘宝交易API调用成功 含session key获取)