o311_api {r311} | R Documentation |
Select an open311 API and attach it to the active session. An open311 API is
an implementation of the open311 standard. It consists of an endpoint name
(e.g. a city), a root URL, and a jurisdiction ID. To unambiguously identify
an API, you can provide an endpoint, a jurisdiction ID, or both. The input
is matched with o311_endpoints
to select an API. The
selected API is available to other o311_*
functions until the
session is terminated or until it is overwritten.
o311_api(
endpoint = NULL,
jurisdiction = NULL,
key = NULL,
format = c("json", "xml")
)
endpoint |
Name of an endpoint that runs an open311 API. This is usually a city, but can be any provider of an open311 API. |
jurisdiction |
ID of a jurisdiction that is served by an open311 API. A jurisdiction
ID is usually the root URL of the jurisdiction website, e.g.
|
key |
If a key is required by the selected API, this argument can be used to
store the key in the R session. The API key is automatically used in
API requests. If |
format |
Response format. Must be one of |
In theory, several jurisdictions can exist for a single endpoints, e.g. if a region serves multiple jurisdictions. Similarly, multiple endpoints can exist for a single jurisdiction, e.g. if a provider has set up both production and test endpoints for a jurisdictions. Providing both endpoint and jurisdiction is thus the most safe way to identify an API.
By default, only a handful of endpoints are supported. For a list of
currently supported endpoints, run o311_endpoints
. You can
add non-default endpoints using o311_add_endpoint
.
A list containing the most important information on a given
jurisdiction, invisibly. This list is attached to the session and can
be retrieved by calling o311_api()
without arguments. Passing no
arguments returns the currently attached API object.
o311_requests
, o311_request
,
o311_services
# cities are matched using regex
o311_api("Cologne")
# passing a jurisdiction is more explicit
o311_api(jurisdiction = "stadt-koeln.de")
# calls without arguments return the current API
o311_api()