I`m a little bit confused about the Facebook Graph API.
First, I created an app on the developers page and then I autorized my app with a URL like this:
www.facebook.com/dialog/oauth?client_id=MY_CLIENT_ID&redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent
Ok… after this the page returned an URL like this one:
www.facebook.com/connect/login_success.html#access_token=ACCESS_TOKEN&expires_in=5171411&code=CODE
I realized that the ACCESS_TOKEN returned is always the same. So i used to search for users, like this:
graph.facebook.com/search?q=QUERY_SEARCH&type=user&access_token=ACCESS_TOKEN
I believe all the URLs above are correct.
My doubt is: i don’t know how to use the long-live token (actually I dont even know if the returned token is a long-lived one). The same token is always returned for me when I use those URLs, so I always use the same ACCESS_TOKEN.
But as i read on the Facebook Graph page, a token can’t be active forever anymore… they now expire.
How do I know if i have a long live token or not? When a token expire how can I “refresh” it?
I was trying to follow the documentation but I`m totally lost…
developers.facebook.com/roadmap/offline-access-removal/
This page says that exists an “deprecate offline_acess” on the advanced settings menu… but it doens’t!
So… i don’t know how to manage tokens when they expire or how to know if i`m using a long-lived token
You can check when your access token is going to expire on Access Token Debugger.
You can get long-lived access tokens by using this api where you need to enter the short lived access token.
where this will return the new long-lived access token. (which will have an expiry period of 2 months.)