I have some issues integrating the Quickbooks API into my KNIME workflow.
I am using the GET node and introducing the authorizing user/password. It has worked in different webpages, but somehow the Quickbooks does not let me use it. Does anybody know why could be that?
I don’t think there is any Knime extension for Quickbooks API. You should be able to use the API via regular Knime GET Request or POST Request nodes.
Have you used the Quickbooks API successfully from other tools than Knime (Postman for example, or cURL)?
If you are not successful, you should read the API and understand how to use it properly. In most cases, it must be some headers missing. The API documentation should explain to you how and what to pass/send.
Hi Bruno! Thanks for your answer. I am not new into this, but somehow it appears I am within Knime :S
Nevertheless, thanks for your answer. I already tried other APIs (not quickbooks), and was successful on them. Could be I am not the admin of the account and I need permission. Need to double check. But I was using POST and GET other times for other APIs and was successful on them. Whenever I get to know the solution, will try to post it. Thanks!!
Hi @ipazin, thanks for your interest. I am getting Error 401, which I believe is regarding authentification. Credentials are OK, so may I understand I do not have the permission to perform that? Or do you think it could be another reason?
Hi @Titojurdi , how are you “passing” the credentials? Looking at the api docs, this is not as simple as submitting username and password via the web POST or GET Request to the API.
Your credentials are for requesting an OAuth token, which you have to do first, and then submit your web request for the API using that token. Depending on the lifetime of the token (expiry) and how long the delay is for the next request, you may need to re-request a new token before querying the api next.
So, the 401 you are getting, is it for the api call, or is it for the OAuth token request?
Hi @ipazin , yes I would think it was for the api call, but I don’t want to assume
And yes, it usually requires 2 steps, at least for the first call. Usually the Client ID And Client Secret would be used to request a token. And then you can do the api calls using that token. You do not need to request at token for all the api requests, as long as the token is not expired - I think Quickbooks gives 1hr based on the docs.
So, if you are going to call the api 100 times within an hour, you can re-use the same token. You just need to request for a new token after an hour or after it’s expired
First of all, thanks both for your interest. I may have explained myself a bit too shortly and neither am I an expert in the area, so any help is more than welcomed.
I am already using both the POST request to get the token and the GET for getting the information (I used the GET in former APIs successfully, where I did not need the POST request , so I understand I am getting the POST wrongly). I will define what I am doing step by step:
I am using a Parameter input where I include my Username, Password, Client ID and Secret and the REST API URL (I am using the redirectURL):
I used as the Bearer header value the Identification Code:
And the response that I am getting does not include the access token, neither is showing as JSON (which I do not get). So I understand I am getting something wrong. I am getting the following:
I don’t know if this is fully understandable or if you need to know something else. I may be mixing up the URL/redirect URLs I guess. Otherwise I don’t get it
Hi @Titojurdi , can you explain what this screen is from?
If I’m taking a guess, this would be in the Quickbooks UI and it allows you to get tokens. If that is the case and you are using this, then you are getting the tokens via the UI and not via POST - there are different ways to get tokens, mainly (1) if you go in the Quickbooks UI and use the tool there, which is what this screen is for, and then you would use that token for your API calls, or (2) you can programmatically request tokens via a POST Request. So that takes care of step 1 (getting tokens).
Your step 2 is to send your API call using the tokens obtained from step 1. Whether you should use Bearer or other ways depends on what the API says it should be. At this point, you should not have to use your credentials, only the token.
“I used the GET in former APIs successfully, where I did not need the POST request”: Do you mean the same APIs you are trying to use, or different APIs?
The first assumptions is correct. Nevertheless, it is only for a demo. The idea is to have it within Knime, as otherwise I should update the token every 60 minutes. Will try to get the solution for it and post it in Knime. It has to be something in the URLs that I am using Thanks for the help by the way
Regarding the former APIs, I meant other APIs, for which I had to use the POST request.