【发布时间】:2022-06-10 22:01:08
【问题描述】:
我正在尝试将 Quickbooks 与 Mule 在线集成。到目前为止,我可以使用授权代码配置通过 HTTP 连接器完成身份验证并检索访问令牌。 要使用提取的令牌向 API 发出后续请求,我还需要领域 ID,但我无法提取它。 在初始调用中将返回 realmId 以及有效负载中的授权代码,但是当该过程通过 mulesoft 发生时,无法捕获它,并且如果没有 realmId,我将无法向 API 发出请求。
以下是 HTTP 的 XML 配置
<http:request-config name="HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="36a1c561-9498-4dbf-b323-5c726b20cb6a" > <http:request-connection protocol="HTTPS" host="sandbox-quickbooks.api.intuit.com" port="443"> <http:authentication > <oauth:authorization-code-grant-type externalCallbackUrl="http://localhost:8082/callback" localAuthorizationUrl="https://localhost:8082/login" authorizationUrl="https://appcenter.intuit.com/connect/oauth2" clientId="ABNxxKq4xy1KWs1BteaIIAhY3NC7G5jg9YZg3h15Zf3waDdEja" clientSecret="5k5GxV3HIBtM7DRSQOqlBqtjWfg07tFNAFeW9EeJ" tokenUrl="https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer" localCallbackUrl="http://localhost:8082/callback" state="abc" scopes="com.intuit.quickbooks.accounting"> <oauth:custom-parameter-extractors > </oauth:custom-parameter-extractors> </oauth:authorization-code-grant-type> </http:authentication> </http:request-connection> </http:request-config>
我需要一种方法来提取 realmId 并动态设置它而不是硬编码。 [这是在token exchange][2]之前获取auth code和realmId的第一个请求
This is how realmId will be used in in subsequent requests after token exchange
【问题讨论】:
-
请分享 HTTP 请求、返回的包含领域 Id 的有效负载以及领域 Id 将如何用于其他请求。
-
@aled 我已添加相关图片
-
请不要对 Stackoverflow 中的代码或日志使用屏幕截图。对于流,请复制 XML。还有应用程序如何接收我现在想要的领域?
-
感谢您的指点,我已经为代码部分添加了 XML。
标签: mulesoft anypoint-studio quickbooks-online mule4 mule-connector