【发布时间】:2019-02-18 07:47:39
【问题描述】:
在这一点上非常难过,希望以前有人能够解决这个问题。我正在尝试创建一个进程,该进程将从 HubSpot 和 SQL Server 同步我的用户数据(通过我的网络应用程序收集)。这将涉及我能够从 SQL Server 写入 HubSpot,反之亦然。为此,我需要使用他们的 API,但我在连接到 API 本身时遇到了问题。
我能够使连接与 Google OAuth 2.0 Playground 一起工作并提取客户数据(所以我知道它们可以工作),但我想创建一个等效的连接 R。根据我目前所做的研究,以下是我认为可能是最好的选择:
在外部:我找到了一家名为 Zapier 的公司,如果我为他们的服务付费,显然可以做到这一点,但我从未使用过它们
-
Inhouse:使用 ROAuth 或 httr 包,但我无法成功验证。我试过了:
reqURL<- 'https://api.hubapi.com/contacts/v1/lists/all/contacts/all' accessURL<- "Couldn't figure out?" authURL<- 'https://app.hubspot.com/oauth/authorize?client_id=[my client id]&scope=contacts%20automation&redirect_uri=https://[mywebsite]' cKey<- 'my hubspot app client id' cSecret<- 'my hubspot app client secret' credentials<- OAuthFactory(consumerKey=cKey, consumerSecret=cSecret, requestURL=reqURL, accessURL=accessURL, authURL=authURL)
也试过了:
curl('https://api.hubapi.com/contacts/v1/lists/all/contacts/all/hapikey=[my hapi key]/get')
有用的链接:
在 Google Playground 中测试 API:https://developers.hubspot.com/docs/faq/testing-hubspot-apis
身份验证概述 https://developers.hubspot.com/docs/methods/auth/oauth-overview
字段:
- 授权端点:https://app.hubspot.com/oauth/authorize
- 令牌端点:https://api.hubapi.com/oauth/v1/token
- 客户 ID:ClientID
- 客户端密码:SecretID
我还有一个 Hapi 密钥和 App ID,但不确定它们是否需要
非常感谢您的帮助!
干杯
【问题讨论】:
标签: r sql-server hubspot