Facebook API: Easily Search for Users by Name

I would like to make a simple search for users by their name from a desktop application using the Facebook graphical API. The result I want to get is a list of usernames and a link to their profile. I spent several hours reading the documentation, but I still don’t really understand which access boxes I need. I created a developer account on Facebook and added a new application. I have an application access token, and I tried to search at the following URL:

https://graph.facebook.com/search?q=john&access_token= {my_app_access_token}

I got the following answer:

{ "error": { "message": "An unknown error has occurred.", "type": "OAuthException", "code": 1 } } 

Now my question is: if you can do such a simple search without a user access token. Therefore, the user sitting in front of my desktop application should NOT enter their Facebook credentials somewhere - never. Can this be done somehow?

+7
facebook facebook-graph-api access-token facebook-access-token
source share
1 answer

When searching, you should indicate the type of search ( user in your case) and answer your question, no, the user access token is required for the search, application tokens will not work for user searches (documented here )

+10
source share

All Articles