Skip to contents

Creates a connection object for REDCap API interactions. This object stores the necessary authentication information and can be used with other sardine functions to interact with your REDCap project.

Usage

redcap_connection(url, token, ssl_verify = TRUE, timeout = 30)

Arguments

url

Character string. The REDCap API URL (typically ends with '/api/')

token

Character string. Your REDCap API token

ssl_verify

Logical. Whether to verify SSL certificates (default: TRUE)

timeout

Numeric. Request timeout in seconds (default: 30)

Value

A redcap_connection object (subclass of sardine_connection)

Examples

if (FALSE) { # \dontrun{
# Create connection using direct parameters
conn <- redcap_connection(
  url = "https://redcap.example.edu/api/",
  token = "YOUR_API_TOKEN"
)

# Create connection using environment variables
conn <- redcap_connection(
  url = Sys.getenv("REDCAP_URL"),
  token = Sys.getenv("REDCAP_TOKEN")
)
} # }