Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create a customer because I receive an Error "Error: AuthResponse is not JSON". #135

Open
Isaacmeedinaa opened this issue Feb 13, 2023 · 2 comments

Comments

@Isaacmeedinaa
Copy link

This is my code:

const response = await intuitOAuthClient.makeApiCall({
      url: `${BASE_URL}/v3/company/${companyNumber}/query?query=select * from Customer&minorversion=65`,
      method: "GET",
      headers: {
        Authorization: `Bearer ${intuitOAuthClient.token.access_token}`,
        "Content-Type": "application/json",
        Accepts: "application/json",
      }
});

I am making a basic API call to get all the customers in my Quickbooks database.

I successfully authenticate with the OAuth 2.0 Client and get the access and refresh tokens.

This is the error I receive:
Error: AuthResponse is not JSON

@Isaacmeedinaa
Copy link
Author

UPDATE:

I tried this, and now I am getting this XML response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2023-02-12T21:41:20.509-08:00"> <Fault type="AuthenticationFault"> <Error code="100"> <Message>General Authentication Error</Message> <Detail>AuthenticationErrorGeneral: SRV-110-Authentication Failure , statusCode: 401</Detail> </Error> </Fault> </IntuitResponse>

Am I not authenticated all though my callback URI is giving me access and refresh tokens?

@ayodeji-desmond
Copy link

@Isaacmeedinaa
Try this
'Content-Type': 'application/text'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants