ChmpClient: chimpr client

Description Public fields Methods Examples

Description

chimpr client

chimpr client

Public fields

dc

(character) a data center

key

(character) an API key

Methods

Public methods


Method new()

Create a new ChmpClient object

Usage
ChmpClient$new(dc = "us7", key = NULL)
Arguments
dc

(character) a data center. default: us7. required.

key

(character) API key. Can either pass in here, or set with Sys.setenv() or pass in to each function call. optional if already set as an environment variable


Method print()

print method for ChmpClient objects

Usage
ChmpClient$print(x, ...)
Arguments
x

self

...

ignored


Method ping()

A health check endpoint for the Mailchimp API

Usage
ChmpClient$ping(...)
Arguments
...

Curl options passed to crul::verb-GET


Method root()

The API root resource links to all other resources available in the API. Calling the root directory also returns details about the Mailchimp user account.

Usage
ChmpClient$root(fields = NULL, exclude_fields = NULL, parse = TRUE, ...)
Arguments
fields

(list/vector) A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation.

exclude_fields

(list/vector) A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation.

parse

(logical) Whether to parse to list (FALSE) or data.frame (TRUE). Default: TRUE

...

Curl options passed to crul::verb-GET


Method clone()

The objects of this class are cloneable with this method.

Usage
ChmpClient$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
(x <- ChmpClient$new(dc = "us7", key = "<your key>"))
(x <- ChmpClient$new())
x$dc
x$key
x$ping()
x$root()

## End(Not run)

sckott/chimpr documentation built on Sept. 17, 2021, 11:04 a.m.