Skip to contents

Connects to an ODK server using the ruODK package and returns either a list of projects or a list of forms, depending on whether a project ID is supplied.

Usage

explore_server(server = "https://odk.gedeop.inrae.fr", credential, pid = NULL)

Arguments

server

Character. Base URL of the ODK server. Defaults to "https://odk.gedeop.inrae.fr".

credential

Character. Path to a plain‑text file containing the username on the first line and the password on the second line.

pid

Character (optional). Identifier of the project to explore. If NULL (default) the function lists all projects; otherwise it lists the forms belonging to the specified project.

Value

A data frame (or list, depending on the underlying ruODK call) containing either the projects available on the server or the forms of the selected project.

Details

The function first checks that credential is provided; if the argument is missing it stops with an informative error.

Examples

## -----------------------------------------------------------------
## The following examples demonstrate the intended usage.
## They are not executed automatically; remove `\dontrun{}` to run.
## -----------------------------------------------------------------
if (FALSE) { # \dontrun{
# Assume the credentials are stored in "my_cred.txt"
# (first line = username, second line = password)
result_projects <- explore_server(
  server = "https://odk.gedeop.inrae.fr",
  credential = "my_cred.txt"
)

# To list forms of a specific project (replace "myProjectId")
result_forms <- explore_server(
  server = "https://odk.gedeop.inrae.fr",
  credential = "my_cred.txt",
  pid = "myProjectId"
)
} # }