Find Expire Time for an access token (page_access_token) when using facebook Graph API in ASP.NET?


Is there any way to use the facebook graph api to find out when a page access token will expire?

There is now an API version of the debugger tool. See https://developers.facebook.com/docs/authentication/access-token-debug/. 

But I can't figure out the expire_date of my page_access_token. Please how can I find when token will expire in ASP.NET or Javascript.

In below picture I was figure out just the page_access_token and the id.

page_access_token_id-min.png

Thanks.

 

 


Asked by:- LuneAgile
0
: 2668 At:- 10/22/2018 11:27:09 AM
ASP.NET graph api page_access_token expiration time







2 Answers
profileImage Answered by:- jaiprakash

You cannot get access token directly, however you can call debugging api

GET /debug_token?input_token={input-token}&access_token={access-token}

which will get your the time, the Access expier_at, you can check the details in this link

https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling

API response contains 

{
    "data": {
        "app_id": 000000000000000, 
        "application": "Your ApplicationName", 
        "expires_at": 1352419328, 
        "is_valid": true, 
        "issued_at": 1347235328, 
        "scopes": [
            "email", 
            "user_location"
        ], 
        "user_id": 1207059
    }
}

Note that the issued_at field is not returned for short-lived access tokens

2
At:- 10/24/2018 9:01:12 AM Updated at:- 10/24/2018 9:01:47 AM
Thanks so much jaiprakash . That what I want. 0
By : LuneAgile - at :- 10/25/2018 11:39:50 AM


profileImage Answered by:- jaya

Access token is expiration is of 60 days, for creating token that never expire follow this answer here

https://stackoverflow.com/a/35481577

I will say better read this article, http://appdevresources.blogspot.com/2012/11/extend-facebook-access-token-make-it.html to make extended tokens (Generate long-lived token for admin of the fan page )

http://appdevresources.blogspot.com/2012/11/retrieving-facebook-page-id-and.html (Generate long-lived token for fan page itself)

Resulted token will never expire (even if administrator of the fan page did log out)

0
At:- 10/22/2018 2:59:28 PM
Hi, Thanks. But I don't need to make my access page token not expired. I need to get the date of expiration of my access page token. from graph api 0
By : LuneAgile - at :- 10/22/2018 3:31:26 PM
You already have got your answer, already you will not get time of expire from api, but it can be for 60 days, as per docs. Default Page access token are short-lived so they expire in 1 or 2 hours. If you want to make it last longer you need to extend the short-lived to a long-lived access token so it will last approximatively 2 months (60 days). 0
By : vikas_jk - at :- 10/22/2018 4:04:50 PM
Thanks, but I need to retrieve this field expires_in from graph api and show it in my view. for example if the expires_in = 234556 I want to retrieve it. 0
By : LuneAgile - at :- 10/22/2018 7:20:27 PM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use