limesurvey api add_participants method cannot add participant

More
5 months 1 week ago #231188 by cetin.sahin
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition
Version 5.3.26+220720
Own server or LimeSurvey hosting: Own server
Survey theme/template: fruity
==================
(Write here your question/remark)
I call limesurvey api add_participants  method  with c#.
Respose message is equal to request 
there is no error. But i can't see adding participant in my survey in portal.
Can you explain how can i call add_participant method step by step via JSONRPC
My c# code : 
                client.Method = "add_participants";
                client.Parameters.Add("sSessionKey", SessionKey);

                client.Parameters.Add("iSurveyID", sid);

       
                var Listeklejson = JsonConvert.SerializeObject(surveyParticipantList);


                client.Parameters.Add("aParticipantData", Base64Encode(Listeklejson));

                client.Parameters.Add("bCreateToken", false);
;
                client.Post();

 

Please Log in to join the conversation.

More
5 months 1 week ago #231189 by cetin.sahin
List<aParticipantData> Listekle = new List<aParticipantData>();
aParticipantData ekle = new aParticipantData { email = "This email address is being protected from spambots. You need JavaScript enabled to view it.", lastname = "test", firstname = "test", language = "tr" , emailstatus = "OK" };
Listekle.Add(ekle);

Please Log in to join the conversation.

More
4 months 1 week ago #231901 by jared.kail
Hi. One thing that tripped me up is that you have to send an array of participants to add_participants and not a single participant. If you are only adding one participant, you still need to send it as a single element of an array. I'm a php coder so my apologies about the syntax difference, but you have to pass this:
[["email"=>"someone@gmail.com", "lastname"=>"Someone", "firstname"=>"Cool"]]

and NOT this:
["email"=>"someone@gmail.com", "lastname"=>"Someone", "firstname"=>"Cool"]

That may not be your issue, but thought I'd throw in what tripped me up just in case.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now