problems with RemoteControl

2 months 3 weeks ago #160916 by mama0107
mama0107 created the topic: problems with RemoteControl
I work with version 2.62 of the Limesurvey. I would like to manage my survey with a small Java program. I use jdk1.8.0_91 and RemoteControl with json.

post.setEntity( new StringEntity("{\"method\": \"activate_tokens\", \"params\":[\""+sessionKey+"\", \""+surveyid+"\", \""+attarray+"\" ],\"id\":1}"));

Result {"id":1,"result":{"status":"OK"},"error":null}

Hashtable<String, String> participantData2 = new Hashtable<String, String>();
participantData2.put("email","This email address is being protected from spambots. You need JavaScript enabled to view it.");
participantData2.put("token", "zgaTDnMSvcJI31V");
participantData2.put("language", "de");
Boolean createToken = false;

post.setEntity( new StringEntity("{\"method\": \"add_participants\", \"params\":[\""+sessionKey+"\", \""+surveyid+"\", \""+participantData2+"\","+createToken+"],\"id\":2}"));

Result {"id":2,"result":"{, token=zgaTDnMSvcJI31V, lastname=Musterfrau, firstname=Eva, emailstatus=OK, language=de}","error":null}

post.setEntity( new StringEntity("{\"method\": \"release_session_key\", \"params\":[\""+sessionKey+"\"], \"id\": 99}"));

Result {"id":99,"result":"OK","error":null}

The participant list was activated, but no participant is created. I can’t find the cause.

Best regards Cornelia

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!