Response is Unauthorize 401 while connecting to qu

2019-02-21 00:04发布

问题:

I am using firefox rest client to make a rest request to quickbook api. below are fields I am using :

URL : https://quickbooks.api.intuit.com/v3/company/companyId/vendor/2
Method : POST

Header : Content-Type : application/xml

OAuth :
Consumer key : ****
consumer secret : ****
Access Token : ****
Access token secret : ****

I am copying these tokens directly from https://appcenter.intuit.com/Playground/OAuth/IA

Strange part is when these tokens are used in data service of IPP V3 Java Devkit, these token works.

I have no idea why these tokens will work with data service devkit and not on rest client.

Please help. Stuck on this from last 4 days.

回答1:

Why do need the rest client for? The Oauth tokens geenrated by Intuit are known to have issues with Rest Clients. That's why we have provided the API explorer to test realms-

https://developer.intuit.com/apiexplorer?apiname=V3QBO

You just need to select your company/realm there.

OR

to debug client issues, there is another OAUTH extension provided by Intuit for Fiddler2.

Fiddler2-http://fiddler.en.lo4d.com/

Extension for OAUTH 1.1- https://github.com/IntuitPartnerPlatform/FiddlerOAuth

1) Copy the extension to ‘My Documents\Fiddler2\Scripts’ folder.

2) You will then see the OAuth settings tab when you open the fiddler client.

3) Generate the Token and Token Secret using Developer playground - Login into developer.intuit.com->Manage my apps->Test connect or Use one of the sample apps from here- https://github.com/IntuitDeveloperRelations/

4) Add the keys generated from step above in the OAuth setting tab, and click Apply.

5) You can fire your requests using Composer tab.

6) Add the correct headers after verifying from API explorer and then Run.

7) You can then view the raw response on the right side of the tab and the status code for the response on the left side.