- Posts: 5
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
Sub Envoi_Mail_LimeSurvey() Const baseUrl As String = "https://xxx.com/index.php/admin/remotecontrol" Dim sessionKey As SessionKey = baseUrl _ .WithHeader("Content-type", "application/json").PostJsonAsync(New With { .method = "get_session_key", .params = New String() {"CodeUser", "MdpUser"}, .id = 1 }).Result.GetJsonAsync(Of SessionKey)().Result Console.WriteLine(sessionKey.result) Dim overrideAllConditions(2) As String overrideAllConditions(0) = "tid = 21" overrideAllConditions(1) = "tid = 22" Dim res = baseUrl _ .WithHeader("Content-type", "application/json") _ .PostJsonAsync(New With { .method = "invite_participant", .params = New Object() {sessionKey.result, "535611", overrideAllConditions, True} }).Result.GetJsonAsync().Result End Sub
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
string Baseurl = "https://xxx/index.php/admin/remotecontrol"; JsonRPCclient client = new JsonRPCclient(Baseurl); client.Method = "get_session_key"; client.Parameters.Add("username", "admin"); client.Parameters.Add("password", "mdp"); client.Post(); string SessionKey = client.Response.result.ToString(); client.ClearParameters(); //Tableau de participants string Participants = new string[2] { "31", "32" }; Newtonsoft.Json.Linq.JToken PartJson =Newtonsoft.Json.JsonConvert.SerializeObject(Participants); if (client.Response.StatusCode == System.Net.HttpStatusCode.OK) { //client.Method = "mail_registered_participants"; //client.Parameters.Add("sSessionKey", SessionKey); //client.Parameters.Add("iSurveyID", 535611); //client.Parameters.Add("tid", 31); //client.Parameters.Add("bEmail", true); //client.Method = "list_participants"; //client.Parameters.Add("sSessionKey", SessionKey); //client.Parameters.Add("iSurveyID", 535611); //client.Parameters.Add("iStart", 0); //client.Parameters.Add("iLimit", 100); //client.Parameters.Add("bUnused", true); //client.Parameters.Add("aAttributes", false); client.Method = "invite_participants"; client.Parameters.Add("sSessionKey", SessionKey); client.Parameters.Add("iSurveyID", 535611); client.Parameters.Add("aTokenIds", PartJson); client.Parameters.Add("bEmail", true); Console.WriteLine("" ); client.Post(); } client.ClearParameters(); Console.WriteLine("Part : " + Participants[0]); Console.WriteLine("Reponse :" + client.Response.result.ToString()); //Console.ReadLine();
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.