Skip to contents

Download kobo data in as json using the v1 API

Usage

retrieve_survey_data(
  path,
  id = NULL,
  token = NULL,
  api = "kobohr",
  overwrite = TRUE
)

Arguments

path

string with path to file where API request should be saved

id

survey id. Usually a 6 digit number. See this support page for an example on how this can be obtained

token

access token for the account e.g. "Token XXXXXXX"

api

Either "kobo", "kobohr", "ona", or a custom (full) URL. API URLs are made available for KoBo Toolbox ("kobo", https://kc.kobotoolbox.org/api/v1/), KoBo Humanitarian Response ("kobohr", https://kc.humanitarianresponse.info/api/v1/), Ona ("ona", https://api.ona.io/api/v1/) and Unhcr ("unhcr", https://kobocat.unhcr.org/api/v1/) . For your own installation, or other installations using the same API but accessed at a different URL, enter the full URL.

overwrite

Will only overwrite existing path if TRUE.

Value

The file path

Examples

if (FALSE) { # \dontrun{
retrieve_survey_data("test.json", id = 753491, token = "XXX")
file.remove("test.json")
} # }