This function generates a list of parameters that can be used to make an API call.
Usage
gen_params(
key = textra_env("TEXTRA_API_KEY"),
secret = textra_env("TEXTRA_API_SECRET"),
name = textra_env("TEXTRA_NAME"),
api_name = "mt"
)Details
Storing the credentials in the environment rather than in your scripts
keeps them out of version control and out of shared files. Add the
following lines to your user .Renviron file, which
usethis::edit_r_environ() opens, and restart R.
Examples
if (FALSE) { # \dontrun{
# Using the credentials stored in .Renviron (recommended).
params <- gen_params()
# Or passing them explicitly.
key <- "abcdefghijklmnopqrstuvw01234567890abcdef1" # API key
secret <- "xyzabcdefghijklmnopqrstuvw012345" # API secret
name <- "login_ID" # login_ID
params <- gen_params(key = key, secret = secret, name = name)
} # }