Intuit API request failing with generic error when connecting to Desktop, but works for Online
-
21-12-2019 - |
Вопрос
Using the IPP.NET SDK v2.0.1, having an issue where simple requests are failing with generic error messages specifically when connecting to a QuickBooks Desktop instance.
Online works fine.
Connection Method:
public QBClient(string appToken, string companyId, string accessToken, string accessTokenSecret, string consumerKey, string consumerSecret, ServiceType qbService)
{
AppToken = appToken;
CompanyID = companyId;
AccessToken = accessToken;
AccessTokenSecret = accessTokenSecret;
ConsumerKey = consumerKey;
ConsumerSecret = consumerSecret;
IntuitServicesType ist = IntuitServicesType.QBO;
if (qbService == ServiceType.QBDesktop)
{
ist = IntuitServicesType.QBD;
}
_oAuthValidator = new OAuthRequestValidator(AccessToken, AccessTokenSecret, ConsumerKey, ConsumerSecret);
_serviceContext = new ServiceContext(AppToken, CompanyID, ist, _oAuthValidator);
string ticket = _serviceContext.Ticket;
this.DataService = new Intuit.Ipp.DataService.DataService(_serviceContext);
}
The connection method above throws no exceptions. However, the following call:
DataService.FindAll<Intuit.Ipp.Data.Customer>(customer, 1, 1000);
produces the following request / response captured in Fiddler:
Request:
URL: POST https://quickbooks.api.intuit.com/v3/company/COMPANY-ID-REMOVED/query
Body: select * from Customer startPosition 1 maxResults 1000
Response:
{"Fault":{"Error":[{"Message":"Operation failed, see details for error","code":"1000"}],"type":"Validation"},"time":"2013-11-16T00:20:30.739Z"}
What should be changed to successfully query QuickBooks Desktop?
Решение
V3 QBD can return at max 500 results in a time unlike V3 QBO which can return 1000. Please alter your query. We have an enhancement request up for this.