Skip to contents

Download responses from the API for a specific asset

Usage

get_data(
  asset_id,
  api = api,
  auth_type = c("client", "token"),
  auth_key = NULL
)

Arguments

asset_id

(character) The ID of the form to be accessed (as a character string). Must be a KPI-type ID (not api V1 ID). See download_forms_all for more details.

api

(character) The type of API to be used or URL at which the API can be accessed. Can be either: - `humanitarian_response`: "https:://kobo.humanitarianresponse.info" will be used as the base URL (default) - `kobotoolbox`: "https:://https://kf.kobotoolbox.org" will be used as the base URL - `custom`: custom URL. Must at least start with "https://"

auth_type

(character) Two types of authentication are possible: - `client`: use the `auth_key` `user:password` to authenticate to the kobo API - `token`: uses the `token` provided in `auth_key` to authenticate

auth_key

(character) Can either be: - A combination of the kobo and password in format: `user:password` (e.g. 'my_user:my_password') - A kobo API V2 token. See the https://support.kobotoolbox.org/api.html

Value

A data frame with the responses data for ´asset_id´