Kundan
Kundan

Reputation: 99

Check If access_token is valid

I have A Facebook App which auto post birthday reminders.

I stored tokens in database.

But Now most of them are expired.

I am trying to make a PHP file which will find valid tokens from my database and save them.

$query = mysql_query("select fb_token from fb_user")


while ($row = mysql_fetch_array($query)) {
$url = "https://graph.facebook.com/me?access_token=".$row['fb_token']."";

}

By with this Code I'm getting each token. Need Help to Save only valid tokens.

Upvotes: 0

Views: 322

Answers (1)

Kristian Vitozev
Kristian Vitozev

Reputation: 5971

You can create request to the following Open Graph URL, basically you need to provide your APPID and access_token.

https://graph.facebook.com/oauth/access_token_info?client_id=APPID&access_token=xxxxxxxxx

The response will contain expiry time of specified token.

Upvotes: 1

Related Questions