当令牌有效时连接到 quickbook api 时响应为 Unauthorize 401 [英] Response is Unauthorize 401 while connecting to quickbook api when tokens are valid

查看:44
本文介绍了当令牌有效时连接到 quickbook api 时响应为 Unauthorize 401的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 firefox rest 客户端向 quickbook api 发出休息请求.以下是我正在使用的字段:

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 : ****

我直接从 https://appcenter.intuit.com/Playground/OAuth 复制这些令牌/IA

奇怪的是,当这些令牌用于 IPP V3 Java Devkit 的数据服务时,这些令牌有效.

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

我不知道为什么这些令牌适用于数据服务 devkit 而不适用于其余客户端.

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

请帮忙.过去 4 天一直坚持这个.

Please help. Stuck on this from last 4 days.

推荐答案

为什么需要剩下的客户端?众所周知,由 Intuit 生成的 Oauth 令牌与 Rest Clients 存在问题.这就是我们提供 API Explorer 来测试领域的原因-

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.

为了调试客户端问题,Intuit 为 Fiddler2 提供了另一个 OAUTH 扩展.

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

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

OAUTH 1.1 的扩展-https://github.com/IntuitPartnerPlatform/FiddlerOAuth

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

1) 将扩展名复制到My Documents\Fiddler2\Scripts"文件夹.

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

2) 当您打开 fiddler 客户端时,您将看到 OAuth 设置选项卡.

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

3) 生成 Token 和 Token Secret 使用开发者游乐场 -登录 developer.intuit.com->管理我的应用程序->测试连接或者使用此处的示例应用程序之一-https://github.com/IntuitDeveloperRelations/

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) 在 OAuth 设置选项卡中添加上一步生成的密钥,然后单击应用.

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

5) 您可以使用 Composer 选项卡触发您的请求.

5) You can fire your requests using Composer tab.

6) 从 API Explorer 验证后添加正确的标头,然后运行.

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

7) 然后您可以查看选项卡右侧的原始响应和左侧的响应状态代码.

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.

这篇关于当令牌有效时连接到 quickbook api 时响应为 Unauthorize 401的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆