plaid/plaid-python

Access Token

Closed this issue · 3 comments

As my server is running in another file, how do I retrieve my access token? The quickstart was a bit confusing for me.

Check the comment for an explanation

from plaid import Client
# here you need to input your keys after your registration on plaid. 
client = Client(client_id='***', secret='***', environment='sandbox')
# you are to get a  public token from your testing sandbox or production sandbox either mobile or web and input it where you see "Plaid Link public_token" which will return a json data containing an access_token.
exchange_token_response = client.Item.public_token.exchange('[Plaid Link public_token]')
access_token = exchange_token_response['access_token']

Thanks @hamzzy! @CameronBurley were you able to understand based on hamzzy's comment?

How it works is:

  1. Our Link SDK, which is launched on your app's frontend, will pass you a public_token in its onSuccess callback if the end user goes through the Link flow successfully.
  2. Once this happens, you should make an API request with this public_token to your backend where you can call `client.Item.public_token.exchange('[insert public token here]') which will return you an access_token.
  3. Use this access_token to fetch data using Plaid endpoints

My pleasure @otherchen