fbad_init: Initiate Facebook Account with OAuth token

Description Usage Arguments Value Examples

Description

If you do not have a token, then register an (e.g. "Website") application at https://developers.facebook.com/apps and make a note of your "App ID" and "App Secret" at the "Dashboard" of your application. Then go to "Settings", click on "Add Platform", then "Website" and paste http://localhost:1410 as the "Site URL". Save, and then run the below example R commands to get your token. Please note that your app needs access to your ads as well, see https://developers.facebook.com/docs/marketing-api/access for more details.

Usage

1

Arguments

accountid

Facebook Ad account id without the act_ prefix

token

Facebook OAuth token as a string

version

Facebook Marketing API version

Value

list returned invisibly containing versioned base URL and relevant API parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## You can generate a token for future use with the help of `httr`, e.g.
library(httr)
app <- oauth_app("facebook", your_app_id,  your_app_secret)
oauth2.0_token(oauth_endpoints("facebook"), app,
  scope = '',
  type  = "application/x-www-form-urlencoded")$credentials$access_token

## Then pass this token with your account ID to fbad_init

## End(Not run)

laziob/fbradsmod documentation built on May 3, 2019, 9:38 p.m.