Response is Unauthorize 401 while connecting to quickbook api when tokens are valid

旧巷老猫 提交于 2019-12-01 12:12:14

问题


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.



来源:https://stackoverflow.com/questions/25025085/response-is-unauthorize-401-while-connecting-to-quickbook-api-when-tokens-are-va

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!