Class used to call the PublicToken sub-product

Sections
Namespace
Methods
C
E
Public
Instance Public methods
create(access_token)

Creates a public token from an access_token.

Does a POST /item/public_token/create call which can be used to initialize Link in update mode.

access_token

access_token to create a public token for

Returns

Returns a CreateResponse object with a public token and expiration info.

# File lib/plaid/products/item.rb, line 38
def create(access_token)
  puts 'Warning: this method will be deprecated in a future version. '\
       'To replace the public_token for initializing Link, look into '\
       'the link_token at https://plaid.com/docs/api/tokens/#linktokencreate.'

  post_with_auth 'item/public_token/create',
                 CreateResponse,
                 access_token: access_token
end
exchange(public_token)

Exchange a public token for an access_token

Does a POST /item/public_token/exchange call helps you exchange a public token (possibly from Plaid Link) for an access_token you can use in the rest of your app.

public_token

The Public token to get an access_token from.

Returns

Returns an ExchangeResponse object with an access_token and request id.

# File lib/plaid/products/item.rb, line 70
def exchange(public_token)
  post_with_auth 'item/public_token/exchange',
                 ExchangeResponse,
                 public_token: public_token
end