query_kamu_api: Query KaMu API against a given endpoint.

Description Usage Arguments Value Note Author(s) Examples

Description

Function provides a single function to query KaMU API and an cache implementation. It also defines the base URL scheme for the API. API resource parameters are provided a

Usage

1
query_kamu_api(endpoint, query = NULL, cache = FALSE)

Arguments

endpoint

A character URL defining the queried endpoint.

query

list of query parameters.

cache

Sets the cache mode: TRUE = Use cache if available and save to cache, FALSE = Ignore cache if available and do not save to cache, "flush" = Ignore cache if available and save to cache.

Value

httr response object (JSON parsed to a list).

Note

All NULL values from JSON responses are replaced by NAs.

Currently response meta data is not used for anything.

Author(s)

Joona Lehtomaki <joona.lehtomaki@gmail.com>

Examples

1
2
3
4
5
6
7
## Not run: 
# Example using members
members <- query_kamu_api("member")
# Change query limit (default = 20)
members <- query_kamu_api("member", query=list(limit=30))

## End(Not run)

rOpenGov/finpar documentation built on May 26, 2019, 7:48 p.m.