facebook / facebook-python-business-sdk

Python SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
1.29k stars 636 forks source link

Attribute error when requesting `get_ad_accounts()` #466

Closed DiegoAgher closed 6 years ago

DiegoAgher commented 6 years ago

The following part of the tutorial, after the initial bootstrapping, was working yesterday but this morning is crashing.

me = adobjects.AdAccountUser(fbid='me') 
my_accounts = list(me.get_ad_accounts())

I get the following error:

Traceback (most recent call last):
  File "wrapper_example.py", line 8, in <module>
    accounts = get_associated_accounts()
  File "/Users/diegoaguado/synx/indatcom/indat/connect_utils.py", line 19, in get_associated_accounts
    return list(me.get_ad_accounts())
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/adobjects/helpers/adaccountusermixin.py", line 54, in get_ad_accounts
    return self.iterate_edge(AdAccount, fields, params, endpoint='adaccounts')
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/adobjects/abstractcrudobject.py", line 560, in iterate_edge
    cursor.load_next_page()
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/api.py", line 851, in load_next_page
    params=self.params,
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/api.py", line 332, in call
    raise fb_response.error()
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/api.py", line 132, in error
    self.body(),
  File "/Users/diegoaguado/synx/indatcom/env_indat/lib/python3.6/site-packages/facebookads/exceptions.py", line 80, in __init__
    if self._error.get('error_data', {}).get('blame_field_specs'):
AttributeError: 'str' object has no attribute 'get'

Version of the package is 2.11.4

In [2]: facebookads.__version__
Out[2]: '2.11.4'
codytwinton commented 6 years ago

Hi, it seems like this issue has been open for more than a few months now. We have made many changes in the SDK since then, including releasing a new version. If you can repro your specific issue with the latest version of the SDK, please create a new issue or comment here with further details.