i want to know when the access token will expire
i am using httprequest and getting response from the request that contain the link:
https://developers.facebook.com/tools/debug/access_token?q=ACCESS_TOKEN
and searching for the word Expires and trying to read the string between parenthesis which contain (in about x minutes)
but getting error that logged out can any one help me please ?
string site = "https://developers.facebook.com/tools/debug/access_token?q=";
string token = "";
getRequest = (HttpWebRequest)WebRequest.Create(site + token);
string result;
HttpWebResponse res = (HttpWebResponse)getRequest.GetResponse();
using (StreamReader sr = new StreamReader(res.GetResponseStream()))
{
result = sr.ReadToEnd();
}
Console.WriteLine(result);
Console.WriteLine(result.Contains("Expires"));
i am getting false i need to have a result that contain the string “Expires” and read the time that will expire
You can read the docs at https://developers.facebook.com/docs/howtos/login/debugging-access-tokens/
Make a request to
https://graph.facebook.com/debug_token?input_token=INPUT_TOKEN&access_token=ACCESS_TOKENinput_token: the Access Token to debug
access_token: your App Access Token or a valid User Access Token from a developer of the app.
If you are using the FB C# SDK (http://csharpsdk.org/)
You can learn how to get the app access token at http://csharpsdk.org/docs/faq I also updated the docs to include debugging the access token.
Note: When you get the access token from the user make sure to store the expiry dates too, so you can avoid this call.