Skip to contents

This function returns the API version requests are pinned to, as set via the api_version argument of khis_cred(). Returns NULL when no version is pinned, meaning requests use the server's own default version.

Usage

khis_api_version(auth = NULL)

Arguments

auth

(Optional) An auth object containing the DHIS2 credentials. If not provided, the function retrieves the API version from the global auth object.

Value

The pinned DHIS2 API version as a string, or NULL if not set.

Examples


if (FALSE) { # \dontrun{
    khis_cred(username = 'DHIS2 username',
              password = 'DHIS2 password',
              server = 'https://<dhis2-instance>',
              api_version = '40')

    # Retrieve the pinned API version (expect '40')
    khis_api_version()
} # }