[英]How to retrieve data from ebay getFeedback API
我正在尝试使用ebay的getFeedback API为指定用户获取一些数据,并最终获得此代码。
namespace one
{
class Program
{
private static ApiContext apiContext = null;
static void Main(string[] args)
{
ApiContext apiContext = GetApiContext();
GeteBayOfficialTimeCall apiCall = new GeteBayOfficialTimeCall(apiContext);
GetFeedbackCall call = new GetFeedbackCall(apiContext);
call.UserID = "abc";
Console.WriteLine(call.GetFeedback().ToString());
Console.ReadKey();
}
static ApiContext GetApiContext()
{
if (apiContext != null)
{
return apiContext;
}
else
{
apiContext = new ApiContext();
apiContext.SoapApiServerUrl = ConfigurationManager.AppSettings["Environment.ApiServerUrl"];
ApiCredential apiCredential = new ApiCredential();
apiCredential.eBayToken = ConfigurationManager.AppSettings["UserAccount.ApiToken"];
apiContext.ApiCredential = apiCredential;
apiContext.Site = SiteCodeType.US;
return apiContext;
}
}
}
}
它在控制台中打印以下行
eBay.Service.Core.Soap.FeedbackDetailTypeCollection
如何获取原始数据?
call.GetFeedback()返回FeedbackDetailType成员的集合,因此您可以使用foreach检索有关所有特定反馈的信息(例如,反馈分数和其他内容)。
在这里查看FeedbackDetailType成员的完整成员列表!
例如
foreach (FeedbackDetailType feedback in call.GetFeedback())
{
Console.WriteLine(feedback.CommentText);
//and other stuff
}
或者你可以使用类似的东西
call.GetFeedback();
Console.WriteLine(call.FeedbackScore);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.