plaid/plaid-python

I keep getting errors even though I am following the example to exchange a public token for a access token

Closed this issue · 1 comments

I am working in django and am trying to exchange a public token for an access token but I am unable to do so, which is strange because I can generate link tokens just fine.

        public_token = req_data.data.get('publicKey')
        client = plaid.Client(client_id='ClientID',secret = secret ,environment='development')
  
        logging.debug('publicKey:'+public_token)
        response = client.Item.public_token.exchange(public_token)
        logging.debug('after send')
        
        #logging.debug('PlaidAccess:' + response)


        access_token = response['access_token']
        return access_token

this is what my code looks like, just without the credentials. whenever I send a response I get the same status codes I see on postman for the public tokens I use. a 200 for a fresh token and a 400 for an out of date one. But right after that it immediately hits me with a "TypeError: Object of type NameError is not JSON serializable" which I am unable to solve.

hi @jay2jp, please file a support ticket here.