Access Token
Closed this issue · 3 comments
CameronBurley commented
As my server is running in another file, how do I retrieve my access token? The quickstart was a bit confusing for me.
hamzzy commented
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']
otherchen commented
Thanks @hamzzy! @CameronBurley were you able to understand based on hamzzy's comment?
How it works is:
- Our Link SDK, which is launched on your app's frontend, will pass you a
public_token
in itsonSuccess
callback if the end user goes through the Link flow successfully. - 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. - Use this access_token to fetch data using Plaid endpoints
hamzzy commented
My pleasure @otherchen