Description Usage Arguments Details Author(s) Examples
Authenticate through Facebook Graph API with your facebook application which you can create at https://developers.facebook.com/apps
1 2 | fbAuthenticate(app.id, app.secret, scope = "ads_management",
app.name = "optional")
|
app.id |
ID of your facebook app. See facebook apps |
app.secret |
App secret of facebook app. See facebook apps |
scope |
General permissions, either |
app.name |
Name of your app, optional. |
httpuv: Consider loading the httpuv package to avoid issues,
install.packages("httpuv");library(httpuv)
There are two different ways of making authenticated requests. One is to obtain a temporary access token from https://developers.facebook.com/tools/explorer, the other is to use a long-term token provided by this very function.
Either way you will have to create an app; go to https://developers.facebook.com/apps, register as a developer and create a new app. You will also need a verified Facebook account.
To get the short-term token:
Go to facebook's Graph API Explorer: https://developers.facebook.com/tools/explorer
Select your app in the top right corner (defaults to "Graph API Explorer")
Then in the dropdown underneath hit "Get Token" and select "Get User Access Token"
In the popup navigate to "Extended Permissions" and select "ads_management" and/or "ads_read"
Click "Get Access Token" and allow the app in the following popup
Copy and Save the token in your R sesssion.
However, this token has a 2-hour lifetime by default and thus needs to be renewed frequently. The alternative is to create an OAuth token using this function and your "App ID" and "App Secret"
John coene jcoenep@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
## Not run:
# run authentication with your app details
fbOAuth <- fbAuthenticate(app.id = "1234567890123456",
app.secret = "16xx79321xx0130x2x10a08x3e2x80xx",
scope = "ads_management")
print(fbOAuth)
<Token>
<oauth_endpoint>
authorize: https://www.facebook.com/dialog/oauth
access: https://graph.facebook.com/oauth/access_token
<oauth_app> optional
key: 123456789012345
secret: <hidden>
<credentials> access_token, expires
---
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.