getActivity: Get activity log

Description Usage Arguments Author(s) See Also Examples

View source: R/getActivity.R

Description

Get activities on an ad account.

Usage

1
2
getActivity(token, account.id, fields = "default", since = NULL,
  until = NULL, n = 100, limit = 100)

Arguments

token

A valid token as returned by fbAuthenticate or a short-term token from facebook Graph API Explorer.

account.id

The id of the account you want to retrieve (Required), see how to find yours.

fields

There are numerous valid fields defaults to (default) which returns the most popular ones. See findFields

since

date YYYY-MM-DD

until

date YYYY-MM-DD, defaults to now

n

Number of results to retrieve, defaults to 100. When you make an API request, you will usually not receive all of the results of that request in a single response. This is because some responses could contain thousands of objects so most responses are paginated by default.

limit

Number of results requested at each API call, defaults to 100. Sometimes useful to bring it down if many results (n) are required as the API might otherwise return error_code: 1 or in other words an "Unknown error".

Author(s)

John Coene jcoenep@gmail.com

See Also

fbAuthenticate, listAccounts

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# run authentication with your app details
fbOAuth <- fbAuthenticate(app.id = "1234567890123456", 
                          app.secret = "76xx79121xx0130x2x10a08x3e2x80xx", 
                          scope = "ads_management")

# get account ids
acc <- listAccounts(id = "me", token = "XXXXXXXXXXX")

# get activity
act <- getActivity(token = fbOAuth, account.id = sample(act, 1), n = 200)

## End(Not run)

JohnCoene/fbadsinsightsr documentation built on May 28, 2019, 12:55 p.m.