下午好
我今天大部分时间都在努力出口宝洁公司;从我的QBO沙盒公司下载到python数据框架(或者至少是字典)中。我一直在遵循指令here,但我一辈子都无法让身份验证生效。 我一直在使用OAuth playground生成我的授权令牌,代码如下:
from intuitlib.client import AuthClient
from intuitlib.enums import Scopes
import csv
reader = csv.DictReader(open("/home/mike/home_health/quickbooks_details.csv"))
credentials = next(reader)
auth_client = AuthClient(
client_id=credentials.get('client_id'),
client_secret=credentials.get('secret'),
redirect_uri='https://developer.intuit.com/v2/OAuth2Playground/RedirectUrl',
environment='sandbox')
auth_client.get_bearer_token(auth_code='MY_AUTH_CODE', realm_id='MY_REALM_ID')
from quickbooks import QuickBooks
client = QuickBooks(
auth_client=auth_client,
refresh_token=auth_client.refresh_token,
company_id=credentials.get('company_id'),
)
client.get_report(report_type='ProfitAndLoss')
尽管我可能会尝试,但仍会出现以下错误:
AuthorizationException: QB Auth Exception: Application authentication failed
{"warnings":null,"intuitObject":null,"fault":{"error":[{"message":"message=DispatcherError; errorCode=003100; statusCode=401","detail":"","code":"3100","element":null}],"type":"AUTHENTICATION"},"report":null,"queryResponse":null,"batchItemResponse":[],"attachableResponse":[],"syncErrorResponse":null,"requestId":null,"time":1617720333515,"status":null,"cdcresponse":[]}
任何帮助都将不胜感激
谢谢
一切似乎都是对的,只是我不确定你对
company_id
有什么价值。对于client
中的company_id
变量,将其值设置为您拥有的Realm Id
,然后尝试运行它。这对我有用相关问题 更多 >
编程相关推荐