我正在尝试QlikSense REST连接器来连接HubSpot的API。根据HubSpot的文档,我在REST连接器中使用以下参数来生成访问令牌:
method: POST
URL: https://api.hubapi.com/oauth/v1/token
authentication schema: Basic
skip server certificate validation: checked
:: query parameters ::
grant_type = authorization_code
client_id = xxxxxxxxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxxxxxx
redirect_uri = https://www.example.com/
code = xxxxxxxxxxxxxxxxxxxxxxxx (this is the same code i got after authorizing the access to my app using this [https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&scope=contacts%20automation&redirect_uri=https://www.example.com/] )
Content-Type = application/x-www-form-urlencoded;charset=utf-8现在问题是这样的:当我第一次使用一个完全刷新的code = xxxxxxxxxxxxxxxxxxxxxxxx并点击Qliksense窗口对话框上的测试连接时,我获得了成功的连接,但当我试图保存该连接时,我得到了以下错误

现在从这个错误开始,一开始我认为我的auth_code可能已经过期了,但当我再次执行相同的操作(获取刷新AUTH_CODE)时,它(QlikSense)做了同样的事情,即第一次告诉我连接成功,当我试图保存它时,我再次遇到了BAD_AUTH_CODE或error 400 (Bad Request)。
仅供参考。我在Postman中使用相同的参数和设置测试了API,运行起来很棒,但在QlikSense中不是这样。
知道这里发生了什么吗?我确信这不是HubSpot,而是和REST连接器有关。
发布于 2019-01-29 17:01:08
获得访问令牌后,应将其作为标头而不是参数作为'Authorization': 'Bearer {ACCESS_TOKEN}'传递给API
发布于 2019-01-30 05:47:04
像"Content-Type“这样的查询参数应该是headers而不是query
https://stackoverflow.com/questions/54416063
复制相似问题