Code :
Intuit.Ipp.Data.Qbo.AccountQuery qboAccQuery = new Intuit.Ipp.Data.Qbo.AccountQuery();
qboAccQuery.CreateTime = DateTime.Now.Date.AddDays(-20);
qboAccQuery.SpecifyOperatorOption(Intuit.Ipp.Data.Qbo.FilterProperty.CreateTime,
Intuit.Ipp.Data.Qbo.FilterOperatorType.AFTER);
qboAccQuery.CreateTime = DateTime.Now.Date;
qboAccQuery.SpecifyOperatorOption(Intuit.Ipp.Data.Qbo.FilterProperty.CreateTime,
Intuit.Ipp.Data.Qbo.FilterOperatorType.BEFORE);
qboAccQuery.PageNumber = 1;
qboAccQuery.ResultsPerPage = 15;
List<Intuit.Ipp.Data.Qbo.Account> qboAccounts =
qboAccQuery.ExecuteQuery<Intuit.Ipp.Data.Qbo.Account> (co ntext).ToList<Intuit.Ipp.Data.Qbo.Account>();
获取此请求正文Filter = CreateTime:AFTER:2013-06-19T15:28:56 + 05:30&amp; Sort = CreateTime AToZ&amp; PageNum = 1&amp; ResultsPerPage = 100
但它会生成异常InvalidTokenException:{“Unauthorized”}
Exception :
Intuit.Ipp.Exception.InvalidTokenException was caught
HResult=-2146233088
Message=Unauthorized
Source=System
ErrorCode=401
StackTrace:
at Intuit.Ipp.Exception.IdsExceptionManager.HandleException(IdsException idsException)
at Intuit.Ipp.Services.QboService.Get[T](IQboQuery qboQuery, String simpleQuery, Boolean isQuerySpecified)
at Intuit.Ipp.Services.ServiceExtensions.ExecuteQuery[T](IQuery query, ServiceContext serviceContext)
at QbSync.QuickBooksCustomers.Page_Load(Object sender, EventArgs e)
答案 0 :(得分:1)
SDK未正确编码请求正文,因此您需要使用DevDefined并使用SDK反序列化响应。代码示例:https://gist.github.com/IntuitDeveloperRelations/6024616