0

I am trying to use Julia to connect to the REDCap API.
I would like to export a report from a REDCap project as a database.
I keep getting a MethodError that I cannot understand

Here is the code: (I have de-identified the code, however the URL, API_KEY and report_ID are exactly identical to the values I use in the R redcapAPI which works seamlessly)

using REDCap

REDCAP_API = "string of values"
REDCAP_URL = "url"

config_key = REDCap.Config(REDCAP_URL, REDCAP_API, ssl = true)

export_report(config = config_key, report_id = 1000)

I keep getting the following error:

MethodError: no method matching export_report(; 
config=REDCap.Config("url", "string of values", true), report_id=1000)
Closest candidates are:
  export_report(!Matched::REDCap.Config, !Matched::Any; format, 
returnFormat, rawOrLabel, rawOrLabelHeaders, exportCheckboxLabel, 
file_loc) at 
C:\Users\username\.julia\packages\REDCap\1M6Y9\src\Export.jl:348 got 
unsupported keyword arguments "config", "report_id"
top-level scope at none:0

Any help much appreciated

wibeasley
  • 5,000
  • 3
  • 34
  • 62
mdb_ftl
  • 423
  • 2
  • 14

1 Answers1

1

config and report_id are positional rather than named parameters in REDcap.jl. You just need to change it to something like:

export_report(config_key, 1000)
ig0774
  • 39,669
  • 3
  • 55
  • 57