+ Start a Discussion
JeffreyStevensJeffreyStevens 

Quickbooks online oAuth version wrong

I'm getting connected to QB Online and authenticated, but now I'm trying to get a list of accounts.  I'm getting an invalid version on my return.

Here is the request that I'm using....
system.HttpRequest[Endpoint=https://sandbox-quickbooks.api.intuit.com/v3/company/13860xxxxx/query?query=SELECT * FROM Account, Method=GET]

The header is this:
OAuth oauth_consumer_key="qyprdkbWYESxxxxxxxxxxxxxH", oauth_nonce="-1898820638843667087", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1454507703", oauth_token="qyprdswhS3apsDvUS3HmHxxxxxxxxxxxxxxx7X0tKGxBj3oCmnU", oauth_version="1.0", Host="qbo.intuit.com", Connection="Keep-Alive", oauth_signature="rgnqOLJqe11xxxxxxxoyG82voyMg%3D"

And my response is:
System.HttpResponse[Status=Unknown Version, StatusCode=400]

I've tried taking the version out.  I've tried chainging it to 2.0 - I still get the same error.

​Any thoughts?
Best Answer chosen by JeffreyStevens
JeffreyStevensJeffreyStevens
Finally got this working.  Intuit support had confirmed that my tokens and secrets were correct.  But that I was having a problem with the sign method. It was just typing error.  (was concatenating my parameters together with a "-" instead of a "=").  The endpoint DID stay at https://sandbox-quickbooks.api.intuit.com/v3/company/ .....
Thank to all of looked at this with me. 

All Answers

pconpcon
You are doing a GET request against that endpoint.  According to the documentation [1] you should be doing a POST request.

[1] https://developer.intuit.com/docs/api/accounting/Account
JeffreyStevensJeffreyStevens
Thanks - I tried that - exactly the same error.

I wonder if I need to encode my strings?  Notice how I have spaces in the query statement?
Force TechieForce Techie

Hey Jeff,

I am having one question why are you using qbo.intuit.com url as host? Please try it with below:
qb.sbfinance.intuit.com

Thanks!
Padmesh

JeffreyStevensJeffreyStevens
Um - I'm doing Quickbooks ONLINE integration.  I think the qb.sbfinance.intuit.com is for Quickbook integration?  Not sure though.  I did try the qb.sbfinance.intuit.com - and it didn't work.  Although I'm getting a not authorized error now.  Even though I get through the oAuth connections and get a access token.
JeffreyStevensJeffreyStevens
Finally got this working.  Intuit support had confirmed that my tokens and secrets were correct.  But that I was having a problem with the sign method. It was just typing error.  (was concatenating my parameters together with a "-" instead of a "=").  The endpoint DID stay at https://sandbox-quickbooks.api.intuit.com/v3/company/ .....
Thank to all of looked at this with me. 
This was selected as the best answer
Hamad AmaralHamad Amaral
Hi Jeffrey,

I have the same issue with QuickBooks queries, my code works fine with other API calls but fails on queries. I pretty sure my sign method is correct but I think I have some issue encoding the query param. If you have the possibility would mind share your code?

Thanks in advance.


 
Syed Subhan 9Syed Subhan 9
Hi All,

Can anyone post the custom code to integrate Salesforce with Quickbooks using API's. I am new to integration. 
Help will be very much appreciated.


Thanks.