nutterb / redcapAPI-Defunct

R interface to REDCap (http://www.project-redcap.org/)
42 stars 0 forks source link

Function to export survey timestamp or survey invitation log #117

Closed amysheep closed 3 years ago

amysheep commented 6 years ago

Which function can export the survey timestamp or the invitation log?

nutterb commented 6 years ago

I'm not sure which call exports the invitation log you are interested in. I think it's the exportSurveyLink, but I've never used this feature.

In hopes of providing something helpful, I just added a function that let's you build your own call. It's fairly primitive, but could be useful for using API methods for which we haven't built support into the R package.

You'll want to look at the API documentation at redcap.your_instituiton.domain/redcap/api/ and fill in the arguments as needed. To get a survey link, you would do something like

genericApiCall(rcon,
    content = "surveyLink",
    record = "[participant record id]",
    instrument = "[survey instrument name]",
    make_data_frame = FALSE)

If you're interested in when a participant completed a survey, that can be obtained using the survey = TRUE argument of exportRecords.