Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Use add_participants with C#

2 years 1 month ago #212316 by frederic.tahir

I'm trying since e few hours to add particpants to a survey in my C# program .... the session is OK, the participants are created but without any datas (email, attributes, ...)

Here under the code that 'm testing but i'm not sure at all about the array which contain the participants datas, i didn't found any sample end/or doc ;-)

 string Baseurl = " xxx.limesurvey.net/admin/remotecontrol ";
 JsonRPCclient client = new JsonRPCclient(Baseurl);
 client.Method = "get_session_key";
 client.Parameters.Add("username", "me");
 client.Parameters.Add("password", "mypassword");
 string SessionKey = client.Response.result.ToString();

            if (client.Response.StatusCode == System.Net.HttpStatusCode.OK)
                string[,] mtables = new string[,]

                client.Method = "add_participants";
                client.Parameters.Add("sSessionKey", SessionKey);
                client.Parameters.Add("iSurveyID", 2534);
                client.Parameters.Add("aParticipantData", Newtonsoft.Json.Linq.JToken.FromObject(mtables));
                client.Parameters.Add("bCreateToken", false);

                string retour=client.Response.error;
                System.Net.HttpStatusCode coderetour =client.Response.StatusCode ;

Is someone have already develop in C# this kind of job ?

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose