public void sms_queue_init() { SMSQ getQueued = Json.Get(); if (getQueued == null) { return; } if (getQueued.count == 0) { return; } foreach (SMSQueues objSMS in getQueued.data) { Console.WriteLine("{0} SMS Processing... " + objSMS.mobile); Queued queue = new Queued() { company_uid = 0, mobile = objSMS.mobile, message = objSMS.message, status = 1 }; bool result = Notification.Send(queue); if (result) { Logs(200, string.Format("{0} | Message Sent to {1}", objSMS.Id, objSMS.mobile)); System.Threading.Thread.Sleep(1500); JSON_Response json_r = Json.Update(objSMS.Id); //if (json_r.status == 200) //{ // System.Threading.Thread.Sleep(100); // string message = "NOTE: Please do not reply to dis mobile#. Unfortunately, we are unable to respond to inquiries sent to dis mobile#."; // queue = new Queued() // { // company_uid = 0, // mobile = objSMS.mobile, // message = message, // status = 1 // }; // result = Notification.Send(queue); // Logs(200, string.Format("Message part 2 sent to {0}", objSMS.mobile)); //} string status = json_r.status == 200 ? "Successful." : "Not successful."; Console.WriteLine(status); } } }
public static JSON_Response Update(Int64 id) { string url = ApiUrl + "/api/v1/sms/update/" + id; JSON_Response json = new JSON_Response(); try { WebClient client = new WebClient(); string value = client.DownloadString(url); json = JsonConvert.DeserializeObject <JSON_Response>(value); } catch (Exception ex) { } return(json); }
public static JSON_Response Messenger_Send(string facebook_id, string message) { string url = ApiUrl + "/api/v1/messenger/send/" + facebook_id + "?message=" + message; JSON_Response json = new JSON_Response(); try { WebClient client = new WebClient(); string value = client.DownloadString(url); json = JsonConvert.DeserializeObject <JSON_Response>(value); } catch (Exception ex) { } return(json); }