All the other functions call this one - it's exported only for debugging purposes - so use them instead.

call_api(endpoint, ...)

Arguments

endpoint

Function name e.g. 'getConstituencies'

...

endpoint's (often optional) named arguments

Value

Response content, as unserialized by jsonlite::fromJSON

Details

If you're really curious about implementation, read on. Each API function introspects to see what its function name is, bundles up its named arguments, and calls this function with them. Consequently, aside from a bit of argument checking and/or return value massaging, every function is implemented exactly the same way.