Skip to contents

Function that provides access to the xMart4 API. Currently functionality is limited to accessing lists of tables within marts and the data within them, but additional functionality can be built-in as requested.

Usage

xmart4_api(
  mart,
  table = NULL,
  xmart_server = c("UAT", "PROD"),
  top = NULL,
  query = NULL,
  format = c("none", "csv", "streaming"),
  full_table = TRUE,
  auth_type = "client",
  token = NULL
)

Arguments

mart

Name of the xMart4 mart

table

Name of a table within the mart, otherwise NULL (the default)

xmart_server

Either 'UAT' (the default) or 'PROD'

top

Number of rows of a table to return

query

A single string fitting the Odata protocol that must start with "$filter=".

format

Specification of the output format to be returned by the xMart API. Defaults to "none", but consider switching to "csv" if you are having loading an extremely large table. See the xMart4 API documentation for details on the three options.

full_table

Logical, whether or not to load all the rows in a specified table, defaults to TRUE. If no format is provided, the xMart4 API limits calls to 100,000 rows at a time, so if full_table == TRUE, the function automatically repeats the API call to extract all rows within the xMart4 table. Ignored if format="streaming" or format="csv".

auth_type

Type of authorization to use for the token authorization. If "client" (the default), it uses an AzureAD client setup. The old "wims" method has been discontinued.

token

Access token for xMart4 server. If NULL (the default), the package automatically creates and manages access for the user if Azure client ID and secret set up properly. See vignette("token_setup") for instructions and details.

Value

A data frame.