Facebook Access token
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/search?q=mark@facebook.com&a开发者_运维问答mp;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
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
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 :-
- Login to "https://developers.facebook.com/"
- On the top menu goto "Tools & Support"
- You will be redirected to new screen, on the new page you will find a link "Access Token Tool" just click on it.
- 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.
- 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.
- 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
精彩评论