Вопрос

I am new to facebook. Sorry if I missed some simple part. I can successfully get access_token by from

https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=XXXXXXXX&client_secret=XXXXXXXXX

However, when I used it to do FQL query:

graph = GraphAPI(access_token=access_token, timeout=1000)
query1 = "SELECT id, username, name  FROM profile WHERE contains('Client Name') AND type='user'"
results = graph.fql(query1)

I got following error messages

facebook.GraphAPIError: Must have a valid access_token to access this endpoint

I am using python facebook-sdk for development. Any help will be highly appreciated!!

Thanks!

Это было полезно?

Решение

You are retrieving an app access token:

App access tokens are used to make requests to Facebook APIs on behalf of an app rather than a user. This can be used to modify the parameters of your app, create and manage test users, or read your application's insights.

You want to retrieve a user token instead.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top