bwr_auth: Authenticate with the Brandwatch API

Description Usage Arguments Value Examples

View source: R/bwr_auth.R

Description

Authenticates using specified username and password. Also caches a local version of the authentication token unless otherwise specified.

Usage

1
bwr_auth(un = NULL, pw = NULL, refresh = FALSE, cache = TRUE)

Arguments

un

Your Brandwatch Username

pw

Your Brandwatch Password

refresh

(Boolean) Should the token be refreshed? If no, a token will be read from a locally cached file '.bw_token' if this file is available. If no token is available, or the refresh argument is TRUE, a new token will be requested and cached from the API.

cache

(Boolean) Can the token be locally cached? If TRUE, the token will be cached in the current working directory in '.bw_token'. If FALSE, the token will be not be cached locally.

Value

Invisibly returns the string containing the token returned by Brandwatch. Your environment variable 'BW_TOKEN' will be set to the value of your authentication token.

Examples

1
## Not run: bwr_auth(un = 'mickey@mouse.com', pw = 'itsasmallworld')

Example output



brandwatchR documentation built on May 1, 2019, 10:24 p.m.