Search code examples
pythondjangoplaid

Problem using Python client library for Plaid


I'm following the tutorial, but I get an error when I use item_public_token_exchange.

itempublic_tokenexchange

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

the error:

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'))

Not sure what is happening.


Solution

  • It looks like the problem is that you are trying to connect to sandbox instead of sandbox.plaid.com. Make sure you have your host set up as plaid.Environment.Sandbox (or, alternatively, sandbox.plaid.com) and not just sandbox.