I'm writing a Python app that is basically a RESTful server for a game, with Flask. But I'm having some issues with facebook-sdk.
Player logs in with facebook on the client game and send me the access token. I'm fetching user data and their friends who also play the game (to build a friendship relationship in my system). But there is a problem, when I try to fetch me/friends?fields=installed
it always get me facebook.GraphAPIError: An active access token must be used to query information about the current user.
If I just query for me/friends
it returns okay.
If I try querying these info directly from Graph API Explorer, it just works fine. But when I go to the python repl it returns the error. I'm trying this:
>>> graph = facebook.GraphAPI("[access-token]")
>>> graph.get_object("me/friends?fields=installed")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/vagrant/venv/local/lib/python2.7/site-packages/facebook.py", line 99, in get_object
return self.request(id, args)
File "/home/vagrant/venv/local/lib/python2.7/site-packages/facebook.py", line 298, in request
raise GraphAPIError(response)
facebook.GraphAPIError: An active access token must be used to query information about the current user.
I'm using the exact same access token as the one on the explorer.
Shouldn't I declare somewhere the current app-key or something?
Thanks.