Call an API operation
Arguments
- api
Registry id.
- operation_id
OpenAPI operationId (use this OR path+method).
- params
Named list of query and path parameters passed to the selected operation.
- path
API path (use with method instead of operation_id).
- method
HTTP method (use with path instead of operation_id).
- parse
Response parsing mode.
- base_url
Optional base URL override.
- body
Optional request body (for POST/PUT requests).
- body_type
Body encoding type ("json" or "form").
- headers
Optional named list of custom HTTP headers.
- safe
Logical; if
TRUE(default), apply rate-limiting and cache GET responses totools::R_user_dir("bunddev", "cache").- refresh
Logical; if
TRUE, ignore cached responses and re-fetch from the API (defaultFALSE).
Value
Parsed response according to parse:
parse = "json"Parsed JSON as an R list.
parse = "text"Character scalar with response body text.
parse = "raw"Raw vector with response bytes.
parse = "xml"xml2document object.
Details
This is the low-level OpenAPI caller. It supports two modes:
Use
operation_idto lookup endpoints by their OpenAPI operationIdUse
path+methodfor APIs without operationIds
The function fills path parameters from params, applies auth (if
configured), and optionally caches GET responses when safe = TRUE.
Use bunddev_parameters() and bunddev_parameter_values() to discover valid
parameters before calling.
See also
bunddev_call_tidy() for adapter-specific tidy outputs, and
bunddev_auth_set() to configure API keys.
Other OpenAPI:
bunddev_cache_dir(),
bunddev_call_tidy(),
bunddev_endpoints(),
bunddev_ms_to_posix(),
bunddev_parameter_values(),
bunddev_parameters(),
bunddev_parameters_for(),
bunddev_spec(),
bunddev_spec_path(),
bunddev_timestamp_to_ms()