
Read Every Submission's Validation Status From a KoBoToolbox Asset
Source:R/validation-kobo.R
list_validation_statuses.RdThe bulk form of get_validation_status(), and the one a pipeline should
use. The data endpoint returns _validation_status alongside _id for up to
1,000 submissions per request, so one asset costs ceiling(n / 1000)
requests rather than one request per submission.
Measured against Timor-Leste's v2 form (64,997 submissions): 65 requests and roughly 70 seconds, against more than twenty minutes for a per-submission loop over 7,776 previously-flagged submissions spread across ten parallel workers. It also covers every submission rather than only those a previous run flagged, so an approval entered by hand on a submission the pipeline never flagged is seen too.
Usage
list_validation_statuses(
asset_id = NULL,
token = NULL,
username = NULL,
password = NULL,
url = "eu.kobotoolbox.org",
page_size = 1000
)Arguments
- asset_id
Character. The KoBoToolbox asset id.
- token
Character. A KoBoToolbox API token, with or without the
Tokenprefix. Ignored whenusernameis supplied.- username, password
Character. Basic-auth credentials.
- url
Character. The KoBoToolbox host. Defaults to
"eu.kobotoolbox.org", matchingget_kobo_data().- page_size
Integer. Submissions per request. KoBoToolbox caps this at 1,000 and silently truncates anything larger.
Value
A tibble with one row per submission: submission_id,
validation_status (not_validated where none is set), validated_at,
validated_by, fetch_error.
Examples
if (FALSE) { # \dontrun{
conf <- read_config()
list_validation_statuses(
asset_id = conf$ingestion$landings$v3$asset_id,
username = conf$ingestion$landings$v3$username,
password = conf$ingestion$landings$v3$password
)
} # }