【问题标题】:QBO - Issue in SpecifyOperatorOption Query FilterQBO - SpecifyOperatorOption 查询过滤器中的问题
【发布时间】:2013-06-21 07:39:34
【问题描述】:
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 & Sort=CreateTime AToZ&PageNum=1&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)

【问题讨论】:

标签: c# quickbooks intuit-partner-platform quickbooks-online


【解决方案1】:

SDK 未正确编码请求正文,因此您需要使用 DevDefined 并使用 SDK 反序列化响应。代码示例:https://gist.github.com/IntuitDeveloperRelations/6024616

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多