将Python客户端库用于Plaid时出现问题



我正在学习教程,但在使用item_public_token_exchange时出错。

项目public_tokeexchange

exchange_request = ItemPublicTokenExchangeRequest(
public_token=plaid_token
)
exchange_response = CLIENT.item_public_token_exchange(exchange_request)

错误:

urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='sandbox', port=80): Max retries exceeded with url: /item/public_token/exchange (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f1493a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

不确定发生了什么。

问题似乎是您试图连接到sandbox而不是sandbox.plaid.com。确保您的主机设置为plaid.Environment.Sandbox(或者sandbox.plaid.com(,而不仅仅是sandbox