parse_endpoint: Parse DHIS2 API endpoint parameters

Description Usage Arguments Value Examples

View source: R/build_endpoint.R

Description

This function parse DHIS2 API endpoint parameters into a list object.

Usage

1
2
3
4
5
6
7
8
parse_endpoint(
  endpoint = NULL,
  id = NULL,
  ref = NULL,
  ref_id = NULL,
  version = NULL,
  ...
)

Arguments

endpoint

A DHIS2 resource or on an API endpoint link, for example 'dataElements' or 'api/dataElements'.

id

The unique identifier of an object in the endpoint, a character string of size 11.

ref

An endpoint reference, a character string.

ref_id

The unique identifier of an object in the referenced endpoint, a character string of size 11.

version

A version of the web API.

...

Additional parameters passed to the api_query.

Value

An S3 object of class 'api_params'.

Examples

1
2
3
4
5
6
# default endpoint endpoint
endpoint_params <- parse_endpoint()
endpoint_params
# endpoint params with a DHIS2 query
endpoint_params <- parse_endpoint(endpoint = "dataElements", field = c("name", "code", "id"))
endpoint_params

INyabuto/dhis2r documentation built on June 14, 2021, 1:15 a.m.