Full Request

Perform a full API request (build, send, parse and clean)

full_request()

Create an API call, send the request and retrieve the results, and parse them

Build

Functions for building API calls.

build_b_call()

Create an API call for B-data flows

build_call()

Build an API call (uses the appropriate function based on the data item)

build_legacy_call()

Create an API call for legacy data

build_remit_call()

Create an API call for REMIT flows

Send

Functions for sending API requests.

send_request()

Send an API request (basically a wrapper to httr:GET that adds a marker for the data item)

Parse

Functions to parse API responses

parse_response()

Parse the results of a call

parse_clean_csv()

Parse a 'clean' .csv response

parse_eof_csv()

Parse a .csv response with a EOF tag left in

try_parse()

Wrapper to the tryCatch version to be used for the parsing function

Clean

Functions to clean parameters before they are added to the request

check_period()

Check the the provided Settlement Period value is valid

fix_parameter()

Fixes parameters provided in the build_x_call() functions

Utility

Utility functions.

clean_date_columns()

Reformat date, time, and datetime columns

check_data_item()

Check the data item to ensure that it is a valid request

check_data_item_version()

Check the data item to ensure that it is valid for the version specified

generation_dataset_example

An example dataset from BMRS showing generation by fuel type.

get_column_names()

Get the column names for a returned CSV Legacy dataset

get_data_items()

Get a vector containing all of the permissible data items

get_data_item_type()

Get the data item type of a data item

get_function()

Get the correct function to create the API call depending on the data item

get_parameters()

Get the required parameters for a data item

change_parameter_name()

Convert a parameter name to a different format

get_cleaning_function()

Get the cleaning function required for a parameter