Facebook API v3.2 connection issue with Rfacebook package in RStudio

1.8k Views Asked by At

I'm connecting to Facebook API v3.2 in order to get my friends information. I had the following error:

Invalid Scopes: user_relationships, publish_actions. This message is only shown 
to developers. Users of your app will ignore these permissions if present. Please 
read the documentation for valid permissions at: 
https://developers.facebook.com/docs/facebook-login/permissions

How to fix this issue using API v3.2?

I have proceeded to the following steps:

  1. I connect to the Facebook API via App: I have created a new Facebook APP (from https://developers.facebook.com) and set it up by default.

  2. I connected to the Facebook API v3.2 via authentication token (from https://developers.facebook.com/tools/explorer) and I obtained access token of all necessary permissions.

I used this R code in RStudio to connect to my API:

install.packages("devtools")
library(devtools)

# I used install_github to get the updated version of Rfacebook package
install_github("pablobarbera/Rfacebook", subdir="Rfacebook")
require (Rfacebook)
  1. I used this fb_oauth to connect my R session with the App I already created and authenticate it to my Facebook profile for Data Mining.
fb_oauth <- fbOAuth(app_id="My_APP_ID", app_secret="MY_APP_SECRET_KEY", extended_permissions = TRUE)

I expect that the token will give access to some of the authenticated user's private information (birthday, hometown, location, relationships) and that of his/her friends, and permissions to post status updates as well as to access check-ins, likes, and the user's newsfeed.

But I got the following error on RStudio command line.

Copy and paste into Site URL on Facebook App Settings: http://localhost:1410/ 
When done, press any key to continue...
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in oauth2.0_access_token(endpoint, app, code = code, user_params = user_params,  : 
  Bad Request (HTTP 400). Failed to get an access token.
0

There are 0 best solutions below