gen_url: Generate a API URL

View source: R/pull_mer.R

gen_urlR Documentation

Generate a API URL

Description

Generate a API URL

Usage

gen_url(
  ou_uid,
  org_lvl,
  org_type = "facility",
  value_type = "results",
  is_hts = FALSE,
  fy_pd = NULL,
  baseurl = "https://final.datim.org/"
)

Arguments

ou_uid

UID for the country, recommend using identify_ouuids()

org_lvl

org hierarchy level, eg facility is level 7 in country X, recommend using identify_levels()

org_type

organization type, either facility (default) or community

value_type

results (default) or targets

is_hts

is the API for HTS indicators (HTS_TST or HTS_TST_POS), default = FALSE

fy_pd

fiscal year(s) to cover, default will be current FY if not provided

baseurl

API base url, default = https://final.datim.org/

Examples

## Not run: 
 #get OU UID
  ouuid <- identify_ouuids() %>% dplyr::filter(ou == "Ghana")
 #get facility level
  faclvl <- identify_levels("Ghana", "facility", username = myuser, password = mypwd())
 #gen url
  myurl <- gen_url(ouuid, faclvl, org_type = facility) 
## End(Not run)

USAID-OHA-SI/Wavelength documentation built on March 24, 2023, 10:07 a.m.