Closed sam2x closed 7 years ago
Ok i have found that access_token for app are just app_id|app_secret. But now i have another problem, when i request the facebook graph api i got :
{
"error": {
"message": "(#12) fql is deprecated for versions v2.1 and higher",
"type": "OAuthException",
"code": 12,
"fbtrace_id": "XXXX"
}
}
I have set
fbgraph.setVersion("2.0");
Not working. Still getting the same error :/
Ok my app was created with the lastest current version of facebook (so 2.4). And facebook wont let me downgrade it to use fql. Like really, i cannot anymore use fql :/ ? Damn why they created it to suppress it one year later....
Looks like no.
"A reminder that API v2.0 will be deprecated in just over one year's time on Aug 7, 2016. If you are still using FQL, we recommend upgrading to API v2.1 or greater as soon as possible."
Now using the normal graph api search, i get :
{ message: '(#200) Must have a valid access_token to access this endpoint',
type: 'OAuthException'}
I don't understand, i cannot emit a graph api search with my own app information(app id/secret) ? Anyone know what is wrong ?
Ok i finally succeeded to do it manually.
First we have to request : "https://graph.facebook.com/{appId}/accounts?access_token={appId}|{appSecret}" In the response we'll get the access_token. We can then perform simple search on the graph api without the need to use oauth authentication or any "redirect" scheme. Pretty useful for server-side request.
facebook changed something recently, it's not working anymore.....
worst api developper team ever... they really sucks...
Hey dudee.. Did you resolve this ? I am having the same problem! :(
Hi,
I have a nodejs server that must interact with facebook graph api. I have created a developper account on facebook, and now i need to interact with the facebook graph api, i'm not sure what is the correct to get the access_token.
So : 1- I have my app developper account 2- I have my app id/secret, I want to generate an accesstoken to request graph api.
3- I request the graph api with the current accesstoken stored in my nodejs "conf" 3'- If the current accesstoken is expire, I want renew automatically the accesstoken on expiration.
On the docs it is written :
"If you get an accesstoken via some other Oauth module" means for me that the accesstoken can be obtained also via this module ? What about the expiration time, or how can i automatically renew the token if he is invalid, must i use another module ?
Thanks you for your answer. Regards.