safe_api_search | R Documentation |
The two internal functions described here handle validating the
parameters passed to the exported search functions and then constructing
API calls from the parameters and the common ids
and
most_recent
arguments.
safe_api_search(endpoint, params, ids = NULL, most_recent = FALSE)
validate_query_param(name, val, class = "character", length = 1)
endpoint |
The name of the search API endpoint to be used. |
params |
A character vector of the query parameters to be passed to the API endpoint. |
ids |
A set of SAFE dataset record IDs to restrict a search. This will
typically be a |
most_recent |
Logical indicating whether to restrict the API to returning only the most recent versions of the datasets found. By default all versions of matching dataset concepts are returned. |
name |
The parameter name |
val |
The user provided input |
class |
Accepted input classes |
length |
Accepted input lengths |
The safe_api_search
function returns an object of class
safe_record_set
of datasets that match the submitted
query. The validate_query_param
function either returns NULL
on success or raises an error.
safe_api_search()
: Constructs, submits and formats calls to
the SAFE API.
validate_query_param()
: A basic query parameter validation handler
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.