Returns an account object, representing the account that you're performing actions on in brandseyer2.

account(codes, ...)

# S3 method for character
account(codes, ..., .show.progress = interactive(), .ignore.cache = FALSE)

# S3 method for data.frame
account(codes, ..., .show.progress = interactive())

Arguments

codes

A vector of one or more account codes, or possibly a tibble (with an account column, such as from account_list())

...

Additional account codes.

.show.progress

A logical indicating whether a progress bar should be shown or not. By default, it will only be shown on interactive sessions. Further, no matter this parameter's value, the bar will only be shown when fetching account information for more than five accounts.

.ignore.cache

Causes account() to always fetch account data from BrandsEye, even if the account cache has data stored.

Value

An account object if one account code is given, or a list of account objects, one for each code given, in the same order as the codes were given.

Details

Typically you may ask for only a single account, by passing a single account code as an argument. You can also pass in multiple account codes, or even a vector of account codes, to be given a list of account objects to act on.

Methods (by class)

  • character: Fetch accounts for one or more account codes given as a character vector. Account codes are unique identifiers for your accounts, and can be obtained from your account manager or by using account_list().

  • data.frame: Get account information from a data.frame. The data.frame should have an account column holding the account's code. account_list() is a function that returns just such a data.frame.

Caching account information

Account information is by default cached for one minute per account. In other words, while the first call to account() to find information for a particular account will spend time on network comms, for the next ten minutes the same call to account() performs no network comms.

Please note that it may cause stale data to be returned. See the .ignore.cache parameter.

Interactive use

When reading multiple accounts at a time, this method will by defualt show a progress bar in interactive environments (such as RStudio). You can control this behaviour using the .show.progress parameter.

See also

accounts() is a synonym for account.

is_account() to test if an object is an account object.

account_code() to get the account code.

account_client_code() to get the account client code.

tags() to find tags in an account.

topics() to find topics in an account.

create_tags() to add more tags to an account.

topic_trees() to find the topic trees in an account.

logs() to read the account's logs.

users() to see what users have access to the account.

rules() for the list of rules applied to mentions in the account.

profiles() for the list of online profiles for the account.

Examples

# Read one account account("TEST01AA")
#> BrandsEye Account #> Name: Test 1 #> Code: TEST01AA #> Client: MKT001
# Read two accounts account("TEST01AA", "TEST02AA")
#> [[1]] #> BrandsEye Account #> Name: Test 1 #> Code: TEST01AA #> Client: MKT001 #> #> [[2]] #> BrandsEye Account #> Name: Test 2 — Best Account #> Code: TEST02AA #> Client: NA #>
# Read accounts from a vector account(c("TEST01AA", "TEST02AA"))
#> [[1]] #> BrandsEye Account #> Name: Test 1 #> Code: TEST01AA #> Client: MKT001 #> #> [[2]] #> BrandsEye Account #> Name: Test 2 — Best Account #> Code: TEST02AA #> Client: NA #>