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
125 stars 159 forks source link

Error : Response has an Error #2

Closed Vaatyk closed 5 years ago

Vaatyk commented 5 years ago

Hi I wanted to use your node.js version 8 script to connect to Quickbooks using Oauth2 and so far so good except whenever I create the realmID and the AcessToken I keep getting in my terminal (I'm on MAC so unix/bash terminal) Error : Respons has an Error From the json error object.

In details :

Response { Url: [Object], rawHeaders: [Array], body: '{"warnings":null,"intuitObject":null,"fault":{"error":[{"message":"message=AuthorizationFailed; errorCode=003100; statusCode=403","detail":null,"code":"3100","element":null}],"type":"SERVICE"},"report":null,"queryResponse":null,"batchItemResponse":[],"attachableResponse":[],"syncErrorResponse":null,"requestId":null,"time":1543012192555,"status":null,"cdcresponse":[]}', status: 403, statusText: 'Forbidden' }, body: '{"warnings":null,"intuitObject":null,"fault":{"error":[{"message":"message=AuthorizationFailed; errorCode=003100; statusCode=403","detail":null,"code":"3100","element":null}],"type":"SERVICE"},"report":null,"queryResponse":null,"batchItemResponse":[],"attachableResponse":[],"syncErrorResponse":null,"requestId":null,"time":1543012192555,"status":null,"cdcresponse":[]}',

Vaatyk commented 5 years ago

I'm getting forbidden 403 errors but my login informations are good.

abisalehalliprasan commented 5 years ago

@Vaatyk ,

Could you check if you are using the correct base url. Looks like using the OAuth-Client you are getting the tokens. And to make any API call, you are getting this error.

For Sandbox companies you need to use sandbox base url : https://sandbox-quickbooks.api.intuit.com/v3/company/

For Production you need to use production base url : https://quickbooks.api.intuit.com/v3/company/

You can take a look at the sample app here

Vaatyk commented 5 years ago

Hi. Thank you for your reply, I checked my apiCall.php and callback.php and changed the baseUrl in the DataService object with the sandbox link you provided and I still get the same error.

It's making me go crazy haha.

On Mon, 26 Nov 2018 at 17:33, abisalehalliprasan notifications@github.com wrote:

@Vaatyk https://github.com/Vaatyk ,

Could you check if you are using the correct base url. Looks like using the OAuth-Client you are getting the tokens. And to make any API call, you are getting this error.

For Sandbox companies you need to use sandbox base url : https://sandbox-quickbooks.api.intuit.com/v3/company/

For Production you need to use production base url : https://quickbooks.api.intuit.com/v3/company/

You can take a look at the sample app here https://github.com/intuit/oauth-jsclient/blob/master/sample/app.js#L120

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/intuit/oauth-jsclient/issues/2#issuecomment-441826386, or mute the thread https://github.com/notifications/unsubscribe-auth/AgBO6aklMghcf6JrhWzdg5-y5VGAObqQks5uzGwlgaJpZM4YxK0r .

Vaatyk commented 5 years ago

Oh I thought this was the php version sorry have a nice day

On Tue, 27 Nov 2018 at 09:31, Vaatik vaattik@gmail.com wrote:

Hi. Thank you for your reply, I checked my apiCall.php and callback.php and changed the baseUrl in the DataService object with the sandbox link you provided and I still get the same error.

It's making me go crazy haha.

On Mon, 26 Nov 2018 at 17:33, abisalehalliprasan notifications@github.com wrote:

@Vaatyk https://github.com/Vaatyk ,

Could you check if you are using the correct base url. Looks like using the OAuth-Client you are getting the tokens. And to make any API call, you are getting this error.

For Sandbox companies you need to use sandbox base url : https://sandbox-quickbooks.api.intuit.com/v3/company/

For Production you need to use production base url : https://quickbooks.api.intuit.com/v3/company/

You can take a look at the sample app here https://github.com/intuit/oauth-jsclient/blob/master/sample/app.js#L120

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/intuit/oauth-jsclient/issues/2#issuecomment-441826386, or mute the thread https://github.com/notifications/unsubscribe-auth/AgBO6aklMghcf6JrhWzdg5-y5VGAObqQks5uzGwlgaJpZM4YxK0r .

abisalehalliprasan commented 5 years ago

Not a problem . Happy coding !