Get responses and all token attributes using remotecontrol 2 api

More
6 months 4 weeks ago #153050 by jsibley
jsibley created the topic: Get responses and all token attributes using remotecontrol 2 api
Is there a way to get all token attributes together with responses using the remotecontrol api, without having to specify each attribute (I have a lot of them)?

I've looked at the documentation, but how to do this still isn't clear to me.

Thanks.

Please Log in to join the conversation.

More
6 months 3 weeks ago #153055 by tammo
tammo replied the topic: Get responses and all token attributes using remotecontrol 2 api
My great "teacher" (Frans Marcelissen) showed me this (using R):

library(limer)
options(stringsAsfactors=FALSE)

LSURL<-[your url to limesurvey api]
LSUSER=[your-user]
LSPASSWORD=[your-password]

options(lime_api = LSURL)
options(lime_username = LSUSER)
options(lime_password = LSPASSWORD)
get_session_key()

sid<-[your sid]
call_limer("list_participants", list(sid,0,999999,F))

all_attributes<- c('id',
'completed',
'participant_id',
'language string',
'usesleft',
'firstname',
'lastname',
'email',
'blacklisted',
'validfrom',
'sent',
'validuntil',
'remindersent',
'mpid',
'emailstatus',
'remindercount',
paste0('attribute_',1:100)
)

call_limer("list_participants", list(sid,0,999999,F, all_attributes))

Maybe this helps. I do not have any experience with other languages.


Tammo ter Hark at Tools for Research
Proud developers of the TFR Responsive Limesurvey template
toolsforresearch.com/limesurvey-responsive-template
The following user(s) said Thank You: Ben_V

Please Log in to join the conversation.

More
6 months 3 weeks ago #153097 by jsibley
jsibley replied the topic: Get responses and all token attributes using remotecontrol 2 api
I look forward to trying this out. As it happens, I'm using r.

Perhaps the only or best way is to specify each attribute, but you showed a nice shortcut I hadn't thought of.

Thanks.

Please Log in to join the conversation.

More
6 months 3 weeks ago #153099 by tammo
tammo replied the topic: Get responses and all token attributes using remotecontrol 2 api
With me, this works.

Tammo


Tammo ter Hark at Tools for Research
Proud developers of the TFR Responsive Limesurvey template
toolsforresearch.com/limesurvey-responsive-template

Please Log in to join the conversation.

More
6 months 3 weeks ago #153105 by jsibley
jsibley replied the topic: Get responses and all token attributes using remotecontrol 2 api
Hi,

Testing this out, it appears that call_limer("list participants"...) returns a data frame that includes another data frame called "participant info". Is that your experience?

This creates a problem for me, as I can't include that data frame and use "filter" in r without getting an error. Might you have a solution for this?

Thanks!

Please Log in to join the conversation.

More
6 months 3 weeks ago #153110 by tammo
tammo replied the topic: Get responses and all token attributes using remotecontrol 2 api
survey_tokens<-call_limer("list_participants", list(survey_list$sid,0,999999,F, all_attributes))

# Clean up token table, because it has a nested dataframe for participant_info
survey_tokens<-cbind(survey_tokens$participant_info, survey_tokens[-c(3)])

This did the trick with me.

Happy R-ing!

Tammo


Tammo ter Hark at Tools for Research
Proud developers of the TFR Responsive Limesurvey template
toolsforresearch.com/limesurvey-responsive-template

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!