2

I had tried to access my FB token using the preliminary code shown by pablo over here :

https://github.com/pablobarbera/Rfacebook

However I get the following error message :

Error in callAPI(query, token) : 
  An active access token must be used to query information about the current user.

I used this code:

fb_oauth <- fbOAuth(app_id="14025", app_secret="5fdb6ef5776",extended_permissions = TRUE)

save(fb_oauth, file="fb_oauth")

load("fb_oauth")

I understand that I am not having access using my token despite authentication completion. Could someone please help.

hering
  • 1,956
  • 4
  • 28
  • 43
  • Facebook has recently shut down API v2.2, so all apps must use at least use v2.3 now - and in that, the format in which the access token is returned has changed, see http://stackoverflow.com/questions/42994019/facebook-graph-api-not-work-from-2-2-to-2-3 - so you might need to update your package. – CBroe Mar 29 '17 at 12:16

1 Answers1

1

Quick fix is just remove type = "application/x-www-form-urlencoded" from fbOauth.R in RFacebook package. Because now Facebook returns response in JSON format.

  • I can confirm that this works to solve OP's problem. – timothyjgraham May 26 '17 at 23:39
  • I have a similar problem with the instaR package. Would it be a similar solution for this type of question? https://stackoverflow.com/questions/75264948/access-token-not-working-to-get-followers-on-instagram-api – nak5120 Jan 28 '23 at 21:00