kbtbr
is a wrapper for the KoBoToolbox APIs. It focuses on API v2 but also makes use of v1 if required (currently no dependencies on v1). kbtbr
not only allows you to pull answers to your surveys directly into your R session but also lets you create and clone assets and import XLS forms straight from your R console. Finally, it provides flexible low-level functions to implement functionalities currently missing from the package yourself.
Installation
kbtbr
is not on CRAN yet. You can install the current version from GitHub:
remotes::install_github("CorrelAid/kbtbr")
Install the development version (unstable!)
remotes::install_github("CorrelAid/kbtbr", ref = "dev")
Get started
library(kbtbr)
# replace with https://kobo.humanitarianresponse.info for the humanitarian server or your own if you self-host
base_url_v2 <- "https://kf.kobotoolbox.org"
token <- Sys.getenv("KBTBR_TOKEN")
kobo <- Kobo$new(base_url_v2, base_url_v1, token)
kobo$get_surveys()
See the Get started and the other articles for more examples!
Limitations
The following limitations of kbtbr
are known to the developers:
- not all endpoints have dedicated functions in the
Kobo
class. This is a conscious choice. Implementing high-level functions for all endpoints would be a lot of work. - no support for pagination
Contributing to kbtbr
Please refer to the CONTRIBUTING.md.