带有oauth2的Quickbooks在线API [英] Quickbooks online API with oauth2

查看:107
本文介绍了带有oauth2的Quickbooks在线API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Quickbooks在线API在我的系统和我的客户在Quickbooks上的帐户之间同步数据.

I need to use Quickbooks online API to synchronize data between my system and my client's accounts on quickbooks.

我需要知道是否可以完成oauth2授权流程并进行API调用而无需人工干预(无需与Intuit的身份验证和授权窗口进行交互)?

I need to know if is it possible to complete the oauth2 authorization flow and make API calls without human interaction (without the need to interact with Intuit's authentication and authorization windows)?

我在以下位置阅读了Intuit的文档: https://developer.intuit. com/docs/0100_quickbooks_online/0100_essentials/000500_authentication_and_authorization/connect_from_within_your_app

I read the Intuit's docs on: https://developer.intuit.com/docs/0100_quickbooks_online/0100_essentials/000500_authentication_and_authorization/connect_from_within_your_app

第一步,我向以下对象发出了GET请求:

On the first step, I made a GET request to:

https://appcenter.intuit.com/connect/oauth2?client_id=MY_ID&scope=com.intuit.quickbooks.accounting&redirect_uri=https%3A%2F%2FMY_NGROK_URL.ngrok.io%2FOAuth2PHPExample.php&response_type=code&state=RandomState#/Authorize/COMPANY_ID

然后,Intuit的身份验证和授权窗口打开,我需要输入用户名和密码,然后单击授权按钮以获取授权代码.

Then, the Intuit's authentication and authorization windows opens and I need to put my username and password and then, click in the authorize button to get the authorization code.

是否可以在不进行身份验证和授权的情况下获取授权码?

Is there a way to obtain the authorization code without authenticate and authorize?

我需要自动执行此任务,以使用PHP在后端进行API调用.

I need to automate this task to make API calls in the backend with PHP.

谢谢, 马塞洛.

推荐答案

是否可以在不进行身份验证和授权的情况下获取授权码?

Is there a way to obtain the authorization code without authenticate and authorize?

否...但请阅读以下内容.

No... but read below.

我需要自动执行此任务,以使用PHP在后端进行API调用.

I need to automate this task to make API calls in the backend with PHP.

您误解了OAuth(1或2)的工作方式.

You are misunderstanding how OAuth (either 1 or 2) works.

第一次连接时,系统会提示您验证/授权对QuickBooks Online数据的访问.

The very first time you connect you will be prompted to authenticate/authorize access to the QuickBooks Online data.

然后为您提供刷新令牌(或访问令牌,具体取决于您使用的是OAuth2还是OAuth1).

You are then given a refresh token (or access token depending on if you're using OAuth2 vs. OAuth1).

然后,您存储该刷新令牌(或OAuth1的访问令牌),并且可以使用该令牌继续进行无人值守的请求,而无需用户参与.

You then store that refresh token (or access token for OAuth1) and can use that token going forward to make your requests, unattended, without requiring the user to be involved at all.

关键要点:您只需要用户在连接时就非常第一次,然后再也不需要.

这篇关于带有oauth2的Quickbooks在线API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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