Title: | Open Data Kit (ODK)-based Computer-assisted Personal Interviewing (CAPI) Tools |
---|---|
Description: | Data collection using computer-assisted personal interviewing or CAPI tools is now the standard approach for conducting surveys and studies. A wide range of CAPI systems are currently being used. The ability to interface with these systems helps in the overall data process. This package provides interface functions to CAPI systems based on the Open Data Kit or ODK technology. |
Authors: | Ernest Guevarra [aut, cre] |
Maintainer: | Ernest Guevarra <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0.9000 |
Built: | 2024-11-14 04:59:28 UTC |
Source: | https://github.com/rapidsurveys/okapi |
Basic authentication to KoBo Toolbox with a username and password
kobo_auth_password(username, password = askpass::askpass())
kobo_auth_password(username, password = askpass::askpass())
username |
KoBo Toolbox username. |
password |
KoBo Toolbox password. Default is an interactive input of password. |
System environment variables for KOBO_KF_USERNAME and KOBO_KF_PASSWORD
kobo_auth_password(username = Sys.getenv("KOBO_USERNAME"), password = Sys.getenv("KOBO_PASSWORD"))
kobo_auth_password(username = Sys.getenv("KOBO_USERNAME"), password = Sys.getenv("KOBO_PASSWORD"))
Basic authentication to KoBo Toolbox with API authentication token
kobo_auth_token(token)
kobo_auth_token(token)
token |
KoBo Toolbox API authentication token. |
System environment variables for KOBO_KF_TOKEN
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN"))
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN"))
Retrieve specific dataset by form ID from specific user
kobo_get_data( base_url = "https://kf.kobotoolbox.org", auth_mode = "token", asset_id )
kobo_get_data( base_url = "https://kf.kobotoolbox.org", auth_mode = "token", asset_id )
base_url |
KoBo Toolbox URL. Default is https://kf.kobotoolbox.org. |
auth_mode |
Password or token? Default is token. |
asset_id |
Unique asset identifier. |
A tibble of datasets available to specific user.
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN")) kobo_get_data(asset_id = "aKJTpKiVUcPYim2epKkPvW")
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN")) kobo_get_data(asset_id = "aKJTpKiVUcPYim2epKkPvW")
Retrieve list of assets available to specific user
kobo_list_assets(base_url = "https://kf.kobotoolbox.org", auth_mode = "token")
kobo_list_assets(base_url = "https://kf.kobotoolbox.org", auth_mode = "token")
base_url |
KoBo Toolbox URL. Default is https://kf.kobotoolbox.org. |
auth_mode |
Password or token? Default is token. |
A list of assets available to specific user.
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN")) kobo_list_assets()
kobo_auth_token(token = Sys.getenv("KOBO_TOKEN")) kobo_list_assets()
Basic authentication to ONA with a username and password
ona_auth_password(username, password = askpass::askpass())
ona_auth_password(username, password = askpass::askpass())
username |
ONA username. |
password |
ONA password. Default is an interactive input of password. |
System environment variables for ONA_USERNAME and ONA_PASSWORD
ona_auth_password(username = Sys.getenv("ONA_USERNAME"), password = Sys.getenv("ONA_PASSWORD"))
ona_auth_password(username = Sys.getenv("ONA_USERNAME"), password = Sys.getenv("ONA_PASSWORD"))
Basic authentication to ONA with API authentication token
ona_auth_token(token)
ona_auth_token(token)
token |
ONA API authentication token. |
System environment variables for ONA_TOKEN
ona_auth_token(token = Sys.getenv("ONA_TOKEN"))
ona_auth_token(token = Sys.getenv("ONA_TOKEN"))
Configure HTTP headers
ona_configure(auth_mode = c("token", "password"))
ona_configure(auth_mode = c("token", "password"))
auth_mode |
Password or token? Default is token. |
An object of class request for HTTP requests
Retrieve specific dataset by form ID from specific user
ona_data_get( base_url = "https://api.ona.io", auth_mode = c("token", "password"), form_id )
ona_data_get( base_url = "https://api.ona.io", auth_mode = c("token", "password"), form_id )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
form_id |
Form identifier. |
A tibble of retrieved dataset.
ona_data_get(form_id = 276175)
ona_data_get(form_id = 276175)
Retrieve list of datasets available to specific user
ona_data_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
ona_data_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
A tibble of datasets available to specific user.
ona_data_list()
ona_data_list()
Delete published form
ona_form_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), form_id = NULL )
ona_form_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), form_id = NULL )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
form_id |
Form identifier. |
Delete specified form from ONA.
form_list <- ona_form_list() form_id <- form_list[["formid"]][form_list[["title"]] == "Appearance Widgets"] ona_form_delete(form_id = form_id)
form_list <- ona_form_list() form_id <- form_list[["formid"]][form_list[["title"]] == "Appearance Widgets"] ona_form_delete(form_id = form_id)
List published forms
ona_form_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
ona_form_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
A tibble of published forms.
ona_form_list()
ona_form_list()
Publish XLSForm
ona_form_publish( base_url = "https://api.ona.io", auth_mode = c("token", "password"), xls_file = NULL, xls_url = NULL, dropbox_xls_url = NULL, project_id = NULL, public = FALSE )
ona_form_publish( base_url = "https://api.ona.io", auth_mode = c("token", "password"), xls_file = NULL, xls_url = NULL, dropbox_xls_url = NULL, project_id = NULL, public = FALSE )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
xls_file |
Path to the XLSForm file. |
xls_url |
URL to the XLSForm file. |
dropbox_xls_url |
Dropbox URL to the XLSForm file. |
project_id |
Project identifier of project to publish XLSForm to. If NULL (default), XLSForm is published to the an account's default project. |
public |
Logical. Should the form be public? Default to FALSE. |
A published form on ONA.
project_list <- ona_project_list() if ("test" %in% project_list$name) { project_id = project_list$id[project_list$name == "test"] ona_project_delete(project_id = project_id) } ona_project_register(name = "test") project_list <- ona_project_list() project_id = project_list$id[project_list$name == "test"] ona_form_publish( xls_file = system.file( "appearance_widgets.xlsx", package = "okapi" ), project_id = project_id )
project_list <- ona_project_list() if ("test" %in% project_list$name) { project_id = project_list$id[project_list$name == "test"] ona_project_delete(project_id = project_id) } ona_project_register(name = "test") project_list <- ona_project_list() project_id = project_list$id[project_list$name == "test"] ona_form_publish( xls_file = system.file( "appearance_widgets.xlsx", package = "okapi" ), project_id = project_id )
Delete registered organisation
ona_org_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), org )
ona_org_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), org )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
org |
Organisation short name or username. |
Delete specified organisation from specific ONA account.
org_list <- ona_org_list() org_name <- org_list[["org"]] ona_org_delete(org = org_name)
org_list <- ona_org_list() org_name <- org_list[["org"]] ona_org_delete(org = org_name)
List organisations
ona_org_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
ona_org_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
A tibble of organisations.
ona_org_list()
ona_org_list()
Register an organisation
ona_org_register( base_url = "https://api.ona.io", auth_mode = c("token", "password"), org, name = NULL )
ona_org_register( base_url = "https://api.ona.io", auth_mode = c("token", "password"), org, name = NULL )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
org |
Organisation short name or username. |
name |
Organisation full name. If NULL (default), short name is used. |
Invisible. Organisation registered and created in ONA account
ona_org_register(org = "okapi_organisation")
ona_org_register(org = "okapi_organisation")
Delete registered project
ona_project_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), project_id = NULL )
ona_project_delete( base_url = "https://api.ona.io", auth_mode = c("token", "password"), project_id = NULL )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
project_id |
Project identifier. |
Delete specified project from specific ONA account.
project_list <- ona_project_list() project_id <- project_list[["projectid"]] ona_project_delete(project_id = project_id)
project_list <- ona_project_list() project_id <- project_list[["projectid"]] ona_project_delete(project_id = project_id)
Get project info
ona_project_info( base_url = "https://api.ona.io", auth_mode = c("token", "password"), project_id = NULL )
ona_project_info( base_url = "https://api.ona.io", auth_mode = c("token", "password"), project_id = NULL )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
project_id |
Project identifier. |
A tibble of projects.
ona_project_info(project_id = 12345)
ona_project_info(project_id = 12345)
List projects
ona_project_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
ona_project_list( base_url = "https://api.ona.io", auth_mode = c("token", "password") )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
A tibble of projects.
ona_project_list()
ona_project_list()
Register a project
ona_project_register( base_url = "https://api.ona.io", auth_mode = c("token", "password"), owner = Sys.getenv("ONA_USERNAME"), name = NULL, public = TRUE )
ona_project_register( base_url = "https://api.ona.io", auth_mode = c("token", "password"), owner = Sys.getenv("ONA_USERNAME"), name = NULL, public = TRUE )
base_url |
ONA URL. Default is https://api.ona.io. |
auth_mode |
Password or token? Default is token. |
owner |
Username or organisation name creating the project. Default to username of currently authenticated account (via 'Sys.getenv(ONA_USERNAME)'). If organisation name, should be an organisation to which currently authenticated account is the owner or admin user. |
name |
Name of the project. If NULL (default), project is given a default name similar to that created by ONA for forms published without a project |
public |
Logical. Should the project be public? Default to TRUE. |
Invisible. Project registered and created in ONA account
ona_project_register()
ona_project_register()