如何解决“格子API:无法获取link_token”错误
我正在尝试使用Windows 11上的Python运行格子API,并且在尝试加载Quickstart时会遇到错误。我使用git bash作为我的外壳,而我的.env文件似乎是正确的,但是我还没有成功地运行它。
我的.env看起来像以下文件。
PLAID_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX
PLAID_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXX
PLAID_ENV=sandbox
PLAID_PRODUCTS=auth,transactions
PLAID_COUNTRY_CODES=US,CA
PLAID_REDIRECT_URI='http://localhost:3000/'
Python服务器端输出以下内容。
127.0.0.1 - - [20/May/2022 00:33:14] "POST /api/info HTTP/1.1" 200 -
127.0.0.1 - - [20/May/2022 00:33:15] "POST /api/create_link_token HTTP/1.1" 200 -
前端侧输出了以下形式的一系列警告。
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
最后,前端页面显示以下错误。
我是戴维和格子API的新手,所以我不确定如何如何补救这个问题。我最初的工作正常工作正确,但不幸的是,一路上都打破了它。我正在运行QuickStart的非docker版本,并使用NPM 6.14.15和节点14.18.3。我使用最新版本(18.2.0)遇到了错误,并遵循另一个Stackoverflow线程恢复。我还将正确的git克隆命令与设置为true的simulinks一起使用,所以我认为这不是问题。
所有指导将不胜感激。
谢谢! :)
编辑:
我尝试记录create_link_token()方法,但它遇到了一个错误并输出例外:
{
"display_message": null,
"documentation_url": "https://plaid.com/docs/?ref=error#invalid-input-errors",
"error_code": "INVALID_API_KEYS",
"error_message": "invalid client_id or secret provided",
"error_type": "INVALID_INPUT",
"request_id": XXXXXXXXXXXXXXXXX,
"suggested_action": null
}
当它到达呼叫时:
response = client.link_token_create(request)
我直接从格子中拉出了我的API键,但我现在仔细检查。
I am attempting to run the plaid api using python on windows 11 and I keep getting an error when trying to load the quickstart. I am using git bash as my shell, and my .env file appears to be correct, but I have not been successful getting it running.
My .env looks like the below file.
PLAID_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX
PLAID_SECRET=XXXXXXXXXXXXXXXXXXXXXXXXX
PLAID_ENV=sandbox
PLAID_PRODUCTS=auth,transactions
PLAID_COUNTRY_CODES=US,CA
PLAID_REDIRECT_URI='http://localhost:3000/'
The python server side outputs the following.
127.0.0.1 - - [20/May/2022 00:33:14] "POST /api/info HTTP/1.1" 200 -
127.0.0.1 - - [20/May/2022 00:33:15] "POST /api/create_link_token HTTP/1.1" 200 -
The frontend side outputs a series of warnings of the form below.
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Lastly, the frontend page displays the following error.
I am new to flask and the plaid api, so I am not sure how to remedy this issue. I originally got the frontened working correctly but unfortunately broke it along the way. I am running the non-docker version of the quickstart and am using npm 6.14.15 and node 14.18.3. I ran into errors using the most recent release (18.2.0) and reverted following another stackoverflow thread. I also used the correct git clone command with simulinks set to true, so I do not think that is the issue.
Any and all guidance would be greatly appreciated.
Thanks! :)
EDIT:
I tried logging the create_link_token() method but it runs into an error and outputs the exception:
{
"display_message": null,
"documentation_url": "https://plaid.com/docs/?ref=error#invalid-input-errors",
"error_code": "INVALID_API_KEYS",
"error_message": "invalid client_id or secret provided",
"error_type": "INVALID_INPUT",
"request_id": XXXXXXXXXXXXXXXXX,
"suggested_action": null
}
When it reaches the call:
response = client.link_token_create(request)
I pulled my API keys directly from plaid, but I am double checking now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案:
看来我将.ENV文件设置为开发构建而不是沙箱。一旦我纠正了API键并重定向,API现在起作用了!
SOLUTION:
It appears I set the .env file up for a development build instead of the sandbox. Once I corrected the api key and redirect, the API now works!