0
votes

i use the following code to authenticate a facebook login

        import os
        import facebookinsights as fi
        pages = fi.authenticate(
        client_id='app_id', 
        client_secret='app_secret_id')

but i receive the following error after manually logging in

Authentication flow completed. You may close the browser tab. Traceback (most recent call last): File "C:/Users/User/Documents/tt.py", line 5, in client_secret='app_secret_id' File "C:\Program Files (x86)\Python35-32\lib\site-packages\facebookinsights__init__.py", line 35, in authenticate return [graph.Page(token) for token in tokens] File "C:\Program Files (x86)\Python35-32\lib\site-packages\facebookinsights__init__.py", line 35, in return [graph.Page(token) for token in tokens] File "C:\Program Files (x86)\Python35-32\lib\site-packages\facebookinsights\graph.py", line 366, in init self.username = data['username'] KeyError: 'username'

any solution about this error?

1
Have you looked at the Facebook python-SDK repository on github? You will have to look through there to find out what the structure is actually like because the documentation is ridiculously maintained (read nonexistent). - calder-ty

1 Answers

1
votes

page = fi.authenticate(token='pageaccesstoken')