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

build_call(data_item, api_key, service_type = "csv",
  api_version = "v1", ...)

Arguments

data_item

character string; data item to be retrieved

api_key

character string; user's API key

service_type

character string; one of "csv" or "xml" to define return format

api_version

character string; API version to use - currently only on version 1

...

values to be passed to appropriate build_x_call function

See also

Examples

build_call(data_item = "TEMP", api_key = "12345", from_date = "12 Jun 2018", to_date = "13 Jun 2018", service_type = "csv")
#> $url #> [1] "https://api.bmreports.com/BMRS/TEMP/v1?APIKey=12345&FromDate=2018-06-12&ToDate=2018-06-13&ServiceType=csv" #> #> $service_type #> [1] "csv" #> #> $data_item #> [1] "TEMP" #>
build_call(data_item = "QAS", api_key = "12345", settlement_date = "01 Jun 2019", service_type = "xml")
#> $url #> [1] "https://api.bmreports.com/BMRS/QAS/v1?APIKey=12345&SettlementDate=2019-06-01&ServiceType=xml" #> #> $service_type #> [1] "xml" #> #> $data_item #> [1] "QAS" #>