问题描述:

I'm interested in using the facebook graph api to pass an email and obtain a person's name... Something like:

https://graph.facebook.com/[email protected]&type=user&access_token=2227470867|2.havcPA9QlMy6tLY1FXqeJA__.3600.1304301600.0-502023190|fejBKRrESzcndWh2rM0ZtyFMGeE

Which returns:

{

"data": [

{

"name": "Mark Zuckerberg",

"id": "4"

}

]

}

My question is how do I get an access_token? I'm not building an app for user's to approve more interested in hitting the API to find a person's name.

Thoughts on how I can get an access token?

Thanks

网友答案:

You will need to create a Facebook application using the Developer app. You can then get an App authentication token (see the App Login section of http://developers.facebook.com/docs/authentication/) and that should let you hit the Graph API.

网友答案:

While working with facebook graph api there are couple of things you should know

  1. First you need to create Facebook app which will give APP ID and APP Secret but not Access Token

    Reference you can follow : - http://techpost360.blogspot.com/2016/10/build-your-own-facebook-app.html

  2. Secondly you need to create the Access Token for the app which you have created in first point. Reference you can follow : -http://techpost360.blogspot.com/2016/10/create-facebook-access-token.html

And off course for performing above two activity you need to login to "http://developers.facebook.com"

Now how to create Access Token please find the steps below :-

  1. Login to "https://developers.facebook.com/"
  2. On the top menu goto "Tools & Support"
  3. You will be redirected to new screen, on the new page you will find a link "Access Token Tool" just click on it.
  4. On the "Access Token Tool" screen you can find all the apps which you have created previously. Just try to find the app which you have created.
  5. Once you find your app than you will find link stating "You need to grant permission to your app to get an access token", just click on the link and your "Access Token" is ready.
  6. For extending the "Access token" limit you can click on Debug and than it will redirect you to new screen where you can just click on "Extend Access TOken"

Hope this will help you to play with the Access Token. For more details you follow reference article links posted above.

Thanks

相关阅读:
Top