intuit / oauth-jsclient

Intuit's NodeJS OAuth client provides a set of methods to make it easier to work with OAuth2.0 and Open ID
https://developer.intuit.com/
Apache License 2.0
119 stars 153 forks source link

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

Open Isaacmeedinaa opened 1 year ago

Isaacmeedinaa commented 1 year ago

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 commented 1 year ago

UPDATE:

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

`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

General Authentication Error AuthenticationErrorGeneral: SRV-110-Authentication Failure , statusCode: 401 ` Am I not authenticated all though my callback URI is giving me access and refresh tokens?
ayodeji-desmond commented 10 months ago

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