Mikhail Surin
Mikhail Surin

Reputation: 13

QBO Payment Query returns 'unauthorized'

When I perform a search by LastUpdatedTime I get "401 Unauthorized Error". Query by CustomerId works fine

Here is my code:

var pq = new PaymentQuery()
{
    LastUpdatedTime = new DateTime(2012,12,21),
};

pq.SpecifyOperatorOption(Intuit.Ipp.Data.Qbo.FilterProperty.LastUpdatedTime, FilterOperatorType.AFTER);
var list = pq.ExecuteQuery<Payment>(commonService.ServiceContext);

Application throws Intuit.Ipp.Exception.InvalidTokenException in ExecuteQuery

Upvotes: 1

Views: 208

Answers (2)

Peter Lavelle
Peter Lavelle

Reputation: 1484

The SDK does not encode the datetime correctly, so you will need to use DevDefined and deserialize the response with the SDK. Code sample: https://gist.github.com/IntuitDeveloperRelations/6024616

Upvotes: 2

Charles
Charles

Reputation: 756

What does the full error look like? Are you able to do other calls fine with this company using the token sets & realm ID that you have in place?

Upvotes: 0

Related Questions