Getting AttributeError: 'Client' object has no attribute 'select_header_accept' while creating IAV token

Hi @shreya i am getting Getting AttributeError: ‘Client’ object has no attribute ‘select_header_accept’ while creating IAV token

  1. import dwollaswagger
  2. customers_api = dwollaswagger.CustomersApi(client)
  3. token = customers_api.get_customer_iav_token(customer_url)
    Traceback (most recent call last):
    File “”, line 1, in
    File “/Users/ghanshyam.sahu/Desktop/plaid-venv/lib/python3.7/site-packages/dwollaswagger/apis/customers_api.py”, line 469, in get_customer_iav_token
    header_params[‘Accept’] = self.api_client.select_header_accept([‘application/vnd.dwolla.v1.hal+json’])
    AttributeError: ‘Client’ object has no attribute ‘select_header_accept’

Hi @Ghanshyam, it appears you are using our swagger generated Python SDK which was last updated in 2017. I would recommend switching over to our Official Python wrapper which is more regularly maintained, with the latest update being 6 days ago. That should fix the error with the accept header.

Let me know if that fixes things, or if you have any questions/concerns!

Hi @shreya Thanks for quick response, but it didn’t solved the problem.

  1. import dwollav2
  2. client = dwollav2.Client(key =‘sIKxHSZd79UYrGtpDsdpMj5RwiLr9h76k9uSI8dscTuqB40L0D’,
    … secret = ‘RnuxWK4LHKEdIsXqqJ8l2XeCCwPNZ4QomQKun7xQ15wM67yOqT’,
    … environment = ‘sandbox’)
  3. app_token= client.Auth.client()
    4.customers_api = dwollaswagger.CustomersApi(client)
    Traceback (most recent call last):
    File “”, line 1, in
    NameError: name ‘dwollaswagger’ is not defined

Hi @Ghanshyam,

With the new Python SDK, application access tokens are used to authenticate against, and to access resources in, the API.

After generating an app_token in Step 3, you can access resources using the get , post and delete methods.

Following is an example code used to retrieve the root of your Sandbox account. Give it a try in place of Step 4 in your code to retrieve your account id -

root = app_token.get('/')
print "The root url is: ", root.body['_links']['account']['href']

Here’s also an example to create an Unverified Customer -

request_body = {
  'firstName': 'Alex',
  'lastName': 'Xela',
  'email': 'alex@email.com'
}
customer = app_token.post('customers', request_body)
customer.headers['location']

You can find more code examples in our API Reference Docs.