public static void Main()
string apiToken = "xxxxxxr";
string apiSecret = "xxxx";
string message_ids = "xxxxxxxx,xxxxxxxx,xxxxxxxx";
string jsonResponse = Check_delivery(apiToken, apiSecret, message_ids);
Console.Write(jsonResponse);
public static string Check_delivery(string apiToken, string apiSecret, string message_ids)
String URI = "http://Lifetimesms.com" +
"api_token=" + apiToken +
"&api_secret=" + apiSecret +
"&messageid=" + message_ids;
WebRequest req = WebRequest.Create(URI);
WebResponse resp = req.GetResponse();
var sr = new System.IO.StreamReader(resp.GetResponseStream());
return sr.ReadToEnd().Trim();
var httpWebResponse = ex.Response as HttpWebResponse;
if (httpWebResponse != null)
switch (httpWebResponse.StatusCode)
case HttpStatusCode.NotFound:
return "404:URL not found :" + URI;
case HttpStatusCode.BadRequest:
return "400:Bad Request";
return httpWebResponse.StatusCode.ToString();