- Posts: 2
- Thank you received: 0
- Forum
- English support forums
- Development
- limesurvey api add_participants method cannot add participant
limesurvey api add_participants method cannot add participant
- cetin.sahin
-
Topic Author
- Offline
- New Member
-
Less
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();
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.
- cetin.sahin
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
5 months 1 week ago #231189
by cetin.sahin
Replied by cetin.sahin on topic limesurvey api add_participants method cannot add participant
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);
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.
- jared.kail
-
- Offline
- New Member
-
Less
More
- Posts: 7
- Thank you received: 0
4 months 1 week ago #231901
by jared.kail
Replied by jared.kail on topic limesurvey api add_participants method cannot add participant
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:
and NOT this:
That may not be your issue, but thought I'd throw in what tripped me up just in case.
[["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.