Learn R Programming

redcapAPI (version 2.7.4)

exportLogging: Export Logging Records

Description

Export the logging (audit trail) of all changes made to a project, including data exports, data changes, project metadata changes, modification of user rights, etc.

Usage

exportLogging(
  rcon,
  logtype = character(0),
  user = character(0),
  record = character(0),
  dag = character(0),
  beginTime = .POSIXct(character(0)),
  endTime = .POSIXct(character(0)),
  ...
)

# S3 method for redcapApiConnection exportLogging( rcon, logtype = character(0), user = character(0), record = character(0), dag = character(0), beginTime = as.POSIXct(character(0)), endTime = as.POSIXct(character(0)), ..., error_handling = getOption("redcap_error_handling"), config = list(), api_param = list() )

Arguments

rcon

A REDCap connection object as created by redcapConnection.

logtype

character with maximum length of 1. The log event types to export. By default, all event types are exported. Must be one of c("export", "manage", "user", "record", "record_add", "record_edit", "record_delete", "lock_record", "page_view")

user

character with maximum length of 1. Users for whom to return logs. By default logs for all users are returned.

record

character with maximum length of 1. Record ID for which logs are to be returned. By default, logs are returned for all records.

dag

character with maximum length of 1. Data access group ID for which to return logs. By default, logs are returned for all data access groups.

beginTime

POSIXct with maximum length 1. When given, only logs recorded after this time will be returned.

endTime

POSIXct with maximum length 1. When given, only logs recorded before this time will be returned.

...

Additional arguments to be passed between methods

error_handling

An option for how to handle errors returned by the API. see redcap_error

config

list Additional configuration parameters to pass to POST. These are appended to any parameters in rcon$config.

api_param

list Additional API parameters to pass into the body of the API call. This provides users to execute calls with options that may not otherwise be supported by redcapAPI.

Author

Benjamin Nutter

Examples

Run this code
if (FALSE) {
url <- "Enter your API URL here"
  token <- "Enter your API token here"
  
  rcon <- redcapConnection(url = url, 
                           token = token)
                    
  # Export all of the logging events       
  exportLogging(rcon)
  
  # Export all of the events for record '2'
  exportLogging(rcon, 
                record = "2")
                
  #Export all of the events where a record was deleted
  exportLoging(rcon, 
               logtype = "record_delete")
}

Run the code above in your browser using DataLab