API Documentations

http / Php / json / xml / C# / .NET / java
Delivery Reports / Pre-built Libraries / Readymade SMS Sending Script


PHP RESTFUL API


If you are going to build your own applications and your requirement is Bulksms , BrandedSMS , Masked SMS and You need a super fast response and better grip in your application then our php Rest API is very advance and good.

Our Docs are such friendly that a normal user can also integrate API with out having deep Developer knowledge. Our Rest api is best choice for international SMS.

All requests are submitted through the HTTP GET / POST Method,

Base URL

< ? php
$username = 'username';
$password = 'password';
$to = '44xxxxxxxx';
$from = 'Brand';
$message = 'Test SMS from Lifetimesms.com';
$url = "http://Lifetimesms.com/plain?username=".$username."&password=" .$password.
"&to=" .$to. "&from=" .urlencode($from)."&message=" .urlencode($message)."";
//Curl Start
$ch = curl_init();
$timeout = 30;
curl_setopt ($ch,CURLOPT_URL, $url) ;
curl_setopt ($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT, $timeout) ;
$response = curl_exec($ch) ;
curl_close($ch) ;
//Write out the response
echo $response ;
?>

Please note: All Required Fields are compulsory! Your Request Can Not move Forward without Required Fields

Information About Parameters

PARAMETERS
username Your Login Username of LifetimeSMS (Required).
password Your Login Username of LifetimeSMS (Required).
to Recepient Mobile Number (Required).
from Your company Name/Brand Name like "xyz" Displayed of Recepient mobile (Required).
type type=unicode FOR unicode SMS (OPTIONAL).
date dd-mm-YYYY Example:25-02-2014 (OPTIONAL)
time hh:mm:ss Example:21:30:55 (OPTIONAL)
message The Message For Recepient (Required).

Return Response and their Meanings

RETURN VALUES
-1 Your request is incomplete and missing some mandatory parameters.
-2 Invalid Recipient Number.
-3 Sender ID cant Be Greater Than 11 Characters.
-4 The Username or Password you supplied is either invalid or disabled or blocked.
-5 Message Length Cant Be exceeded Than 612 Characters.
-6 Balance Error.
-7 SMS Rejected Due to spam Filters.
-8 too many Recepients are Supplied
-9 Unknow error (contact with Department).
-10 Service Down.
-11 Invalid Date For Schedule.

Note: You can Explod Successfull Result by delemeter Collan (:) . First Param for outPut and second to trace Delivery.

Successfull Out Put Response

Send SMS Via Plain API ?

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/plain?username= xxxx&password= xxxx &to =44xxxxxxx&from =Brand &message =this+is+plain+api.

Scheduled SMS For Future Reservation?

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/plain?username= xxxx&password= xxxx &to =44xxxxxxx&from =Branddate=21-05-2016&time= 21:30:50 &message =this+is+plain+api.


Balance Inquiry

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/credit?username= xxxx &password= xxxx

JSON Output API


Welcome to the REST API. Below, you will find a full listing of all the available endpoints. As we add more endpoints, they will be automatically documented here and available through the Documents.

All requests to Lifetimesms must be submitted to the base URL. Lifetimesms provides you with an option of a response as a JSON object, or an XML string - you have to choose required response by selecting the appropriate base URL for your request.All requests to Lifetimesms must be submitted to the base URL. Lifetimesms provides you with an option of a response as a JSON object, or an XML string - you have to choose required response by selecting the appropriate base URL for your request.

You have access to a single, full-featured cloud service that can be leveraged anywhere around the world and easily integrated into your current solutions.


All requests are submitted through the HTTP GET / POST Method,



Base URL

< ? php
$username = 'username';
$password = 'password';
$to = '44xxxxxxxx';
$from = 'Brand';
$message = 'Test SMS from Lifetimesms.com';
$url = "http://Lifetimesms.com/json?username=".$username."&password=".$password."&to=".$to."&from=".urlencode($from)."&message=".urlencode($message)."";
//Curl Start
$ch = curl_init();
$timeout = 30;
curl_setopt ($ch,CURLOPT_URL, $url) ;
curl_setopt ($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT, $timeout) ;
$response = curl_exec($ch) ;
curl_close($ch) ;
//Write out the response
echo $response ;
?>

JSON single Number Response

{"type":"Text","totalprice":1,"totalgsm":1,"remaincredit":41,"messages":[ {"status":1,"messageid":"62891113","gsm":"923456812536"}]}


JSON Multiple Number Response

{"type":"Text","totalprice":"0.05","totalgsm":"6","remaincredit":"63.6433","messages": [ {"status":"1","messageid":"157157","gsm":"9211111111111"}, {"status":"1","messageid":"157154","gsm":"9211111111112"}, {"status":"1","messageid":"157151","gsm":"9211111111113"}, {"status":"1","messageid":"157149","gsm":"9211111111114"}, {"status":"1","messageid":"157142","gsm":"9211111111115"}, {"status":"1","messageid":"157130","gsm":"9211111111116"} ]}


Please note: All Required Fields are compulsory! Your Request Can Not move Forward without Required Fields


Information About Parameters


PARAMETERS
username Your Login Username of LifetimeSMS (Required).
password Your Login Username of LifetimeSMS (Required).
to Recepient Mobile Number (Required).
from Your company Name/Brand Name like "xyz" Displayed of Recepient mobile (Required).
type type=unicode FOR unicode SMS (OPTIONAL).
date dd-mm-YYYY Example:25-02-2014 (OPTIONAL)
time hh:mm:ss Example:21:30:55 (OPTIONAL)
message The Message For Recepient (Required).

Return Response and their Meanings

RETURN VALUES
-1 Your request is incomplete and missing some mandatory parameters.
-2 Invalid Recipient Number.
-3 Sender ID cant Be Greater Than 11 Characters.
-4 The Username or Password you supplied is either invalid or disabled or blocked.
-5 Message Length Cant Be exceeded Than 612 Characters.
-6 Balance Error.
-7 SMS Rejected Due to spam Filters.
-8 too many Recepients are Supplied
-9 Unknow error (contact with Department).
-10 Service Down.
-11 Invalid Date For Schedule.

Simple SMS Via JSON

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/json?username= xxxx&password= xxxx &to =44xxxxxxx&from =Brand &message =this+is+json+api.

Schedule SMS Via JSON

http://Lifetimesms.com/json?username= xxxx&password= xxxx &to =44xxxxxxx&from =Branddate=21-05-2016&time= 21:30:50 &message =this+is+json+api.


Balance Inquiry

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/credit?username= xxxx &password= xxxx

xml API


It is designed to work 24/7. Manages network link failures, service provider failures, and tolerates server reboots.

Extremely Easy integration with your existing IT Systems.

GREAT PERFORMANCE - provides the highest availability, performance, and security to run most demanding SMS applications.

No hardware or software to buy - integration with your system can be easily done by us


All requests are submitted through the HTTP GET / POST Method,



Base URL

< ? php
$username = 'username';
$password = 'password';
$to = '44xxxxxxxx';
$from = 'Brand';
$message = 'Test SMS from Lifetimesms.com';
$url = "http://Lifetimesms.com/xml?username=".$username."&password=" .$password.
"&to=" .$to. "&from=" .urlencode($from)."&message=" .urlencode($message)."";
//Curl Start
$ch = curl_init();
$timeout = 30;
curl_setopt ($ch,CURLOPT_URL, $url) ;
curl_setopt ($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT, $timeout) ;
$response = curl_exec($ch) ;
curl_close($ch) ;
//Write out the response
echo $response ;
?>

XML Number Response

<responce>
<messageid>[Message ID]</messageid>
<status>[Message Status]</status>
<to>[Receipent]</to>
<type>[Message Type]</type>
<price>[Message Price]</price>
<count>[Message Count]</count>
<remainbalance>[Remaine Balance]</remainbalance>
<errortext>[ERROR TEXT]</errortext>
</responce>

Please note: All Required Fields are compulsory! Your Request Can Not move Forward without Required Fields


Information About Parameters


PARAMETERS
username Your Login Username of LifetimeSMS (Required).
password Your Login Username of LifetimeSMS (Required).
to Recepient Mobile Number (Required).
from Your company Name/Brand Name like "xyz" Displayed of Recepient mobile (Required).
type type=unicode FOR unicode SMS (OPTIONAL).
date dd-mm-YYYY Example:25-02-2014 (OPTIONAL)
time hh:mm:ss Example:21:30:55 (OPTIONAL)
message The Message For Recepient (Required).

Return Response and their Meanings

RETURN VALUES
-1 Your request is incomplete and missing some mandatory parameters.
-2 Invalid Recipient Number.
-3 Sender ID cant Be Greater Than 11 Characters.
-4 The Username or Password you supplied is either invalid or disabled or blocked.
-5 Message Length Cant Be exceeded Than 612 Characters.
-6 Balance Error.
-7 SMS Rejected Due to spam Filters.
-8 too many Recepients are Supplied
-9 Unknow error (contact with Department).
-10 Service Down.
-11 Invalid Date For Schedule.

Simple SMS Via XML

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check api interferace

http://Lifetimesms.com/xml?username= xxxx&password= xxxx &to =44xxxxxxx&from =Brand &message =this+is+xml+api.

Schedule SMS Via XML

http://Lifetimesms.com/xml?username= xxxx&password= xxxx &to =44xxxxxxx&from =Branddate=21-05-2016&time= 21:30:50 &message =this+is+xml+api.


Balance Inquiry

http://Lifetimesms.com/credit?username= xxxx &password= xxxx

C# API


When developers search for an SMS Gateway, one of the reasons they turn to us is our wide selection of APIs. These include the HTTP API, SMPP API, XML API, SMTP API and COM Object. Fast, simple, reliable and built in such a way that they integrate with any system or application

C# SMS messaging is one of the services we offer. Use the C# SMS script code below to send SMS via Lifetimesms.com'gateway.

C# is an object-oriented programming language which is implemented on the Microsoft .NET Framework. Microsoft supplies a powerful version free of charge.

Example of C# code script to send SMS




using System;
using System.Net;
using System.Web;


public class Program
{
public static void Main()
{
string MyUsername = "userxxx"; //Your Username At Lifetimesms.com
string MyPassword = "xxxx"; //Your Password At Lifetimesms.com
string toNumber = "44xxxxxxxx"; //Your cell phone number with country code
string Masking = "SMS Alert"; //Your Company Brand Name
string MessageText = "SMS Sent using .Net";
string jsonResponse = SendSMS(Masking, toNumber, MessageText, MyUsername , MyPassword);
Console.Write(jsonResponse);
//Console.Read(); //to keep console window open if trying in visual studio
}
public static string SendSMS(string Masking, string toNumber, string MessageText, string MyUsername , string MyPassword)
{
String URI = "http://Lifetimesms.com" +
"/plain?" +
"username=" + MyUsername +
"&password=" + MyPassword +
"&from=" + Masking +
"&to=" + toNumber +
"&message=" + Uri.UnescapeDataString(MessageText); // Visual Studio 10-15
"//&message=" + System.Net.WebUtility.UrlEncode(MessageText);// Visual Studio 12
try
{
WebRequest req = WebRequest.Create(URI);
WebResponse resp = req.GetResponse();
var sr = new System.IO.StreamReader(resp.GetResponseStream());
return sr.ReadToEnd().Trim();
}
catch (WebException ex)
{
var httpWebResponse = ex.Response as HttpWebResponse;
if (httpWebResponse != null)
{
switch (httpWebResponse.StatusCode)
{
case HttpStatusCode.NotFound:
return "404:URL not found :" + URI;
break;
case HttpStatusCode.BadRequest:
return "400:Bad Request";
break;
default:
return httpWebResponse.StatusCode.ToString();
}
}
}
return null;
}
}

View its Live Response

Online Live Demo Of DOT NET API

ASP.net


Lifetimesms provides you with code examples and programming objects, to help you connect to our gateway using the programming language of your choice. You are welcome to try these scripts.

Microsoft ASP.NET is a web application framework enabling programmers to build dynamic web sites, web applications and web services.


using System;
using System.Net;
using System.Web;


public class Program
{
public static void Main()
{
string MyUsername = "userxxx"; //Your Username At Lifetimesms.com
string MyPassword = "xxxx"; //Your Password At Lifetimesms.com
string toNumber = "44xxxxxxxx"; //Your cell phone number with country code
string Masking = "SMS Alert"; //Your Company Brand Name
string MessageText = "SMS Sent using .Net";
string jsonResponse = SendSMS(Masking, toNumber, MessageText, MyUsername , MyPassword);
Console.Write(jsonResponse);
//Console.Read(); //to keep console window open if trying in visual studio
}
public static string SendSMS(string Masking, string toNumber, string MessageText, string MyUsername , string MyPassword)
{
String URI = "http://Lifetimesms.com" +
"/plain?" +
"username=" + MyUsername +
"&password=" + MyPassword +
"&from=" + Masking +
"&to=" + toNumber +
"&message=" + Uri.UnescapeDataString(MessageText); // Visual Studio 10-15
"//&message=" + System.Net.WebUtility.UrlEncode(MessageText);// Visual Studio 12
try
{
WebRequest req = WebRequest.Create(URI);
WebResponse resp = req.GetResponse();
var sr = new System.IO.StreamReader(resp.GetResponseStream());
return sr.ReadToEnd().Trim();
}
catch (WebException ex)
{
var httpWebResponse = ex.Response as HttpWebResponse;
if (httpWebResponse != null)
{
switch (httpWebResponse.StatusCode)
{
case HttpStatusCode.NotFound:
return "404:URL not found :" + URI;
break;
case HttpStatusCode.BadRequest:
return "400:Bad Request";
break;
default:
return httpWebResponse.StatusCode.ToString();
}
}
}
return null;
}
}

View its Live Response

Online Live Demo Of DOT NET API

What is VB 6.0?


Visual Basic (VB) is the third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model. VB is also considered a programming language that is relatively easy to learn and use, because of its graphical development features and BASIC heritage.


Dim message As String
Dim result As String
Dim myURL As String, postData As String
Dim winHttpReq As Object
message = "Hello this is a test message."
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "http://lifetimesms.com/plain.php"
postData = "username=xxxxxxx&password=xxxxxxxxxxxx&message=" + message +
"&to=92300xxxxxxx&from=Lifetimesms"
winHttpReq.Open "POST", myURL, False
winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
winHttpReq.Send (postData)
SendSMS_Text = winHttpReq.responseText

JAVA OBJECT API


Java refers to a number of computer software products and specifications from Sun Microsystems that toGET / POSTher provide a system for developing application software and deploying it in a cross-platform environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end.

Using the JAVA OBJECT API is a simple way to implement SMS support in your Java environment.

The Sample Code Is Given Below


package sendsms_java;
import java.net.*;
import java.io.*;
public class URLConnDemo {
public static void main(String[] args) {
String request = "http://Lifetimesms.com/plain?username= username
&password= password&to=4476456689977&from= ComapnyName&message= YourMessage";
try
{
URL url = new URL(request);
URL Connection urlConnection = url.openConnection();
Http URLConnection connection = null;
if(urlConnection instanceof Http URLConnection)
{ connection = (HttpURLConnection) urlConnection;
}
else
{
System.out.println("Please enter an HTTP URL.");
return;
}
BufferedReader in = new BufferedReader(
new InputStreamReader(connection.GET / POSTInputStream()));
String urlString = "";
String current;
while((current = in.readLine()) !=
null)
{
urlString += current;
}
System.out.println( urlString); }catch( IOException e)
{
e.print StackTrace();
}
}
}


Mauris rhoncus tincidunt libero quis fringilla

Delivery Reports / Pre-built Libraries / Readymade SMS Sending Script


Delivery Reports


Our network reach, tracked delivery, cost effectiveness and mobile messaging service flexibility make us the logical choice for marketers for bulk sms.

Our robust network and advanced technology will help sms text messaging, sms and mobile messaging providers and bulk sms sellers focus on selling the Bulk SMS service. Resell our RedRabbit branded messaging and Bulk SMS services. Resell Bulk SMS services through a customized user interface that reflects your brand


All requests are submitted through the HTTP GET / POST Method,


Base URL

< ? php
$username = 'username';
$password = 'password';
$messageid = '44xxxxxxxx';
$url = "http://Lifetimesms.com/dlvr?username=".$username."&password=" .$password "&messageid=".$messageid " ";
//Curl Start
$ch = curl_init();
$timeout = 30;
curl_setopt ($ch,CURLOPT_URL, $url) ;
curl_setopt ($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT, $timeout) ;
$response = curl_exec($ch) ;
curl_close($ch) ;
//Write out the response
echo $response ;
?>

Information About Parameters


PARAMETERS
username Your Login Username of LifetimeSMS (Required).
password Your Login Username of LifetimeSMS (Required).
messageid ID of SMS etc 331542005224 (Required).

Please note: All Required Fields are compulsory! Your Request Can Not move Forward without Required Fields




Delivery Report Of Single SMS Using Messageid

{"delivery":[
{"id":"340040232012","status":"DELIVERED","gsm":"923005572048","date":" 15-08-2014 (09:49:46 AM)"}
]}


Delivery Reports Of Multiple SMS (No messageid)

{"delivery":[
{"id":"340040232012","status":"DELIVERED","gsm":"923005572048","date":" 15-08-2014 (09:49:46 AM)"},
{"id":"400413253052","status":"DELIVERED","gsm":"923469240184","date":" 15-08-2014 (09:52:06 AM)"},
{"id":"350205013424","status":"DELIVERED","gsm":"923467841667","date":" 15-08-2014 (09:55:02 AM)"},
{"id":"544230220010","status":"DELIVERED","gsm":"923038038606","date":" 15-08-2014 (09:56:33 AM)"},
{"id":"230201205320","status":"DELIVERED","gsm":"923354899748","date":" 15-08-2014 (09:59:16 AM)"}
]}


Return Response and their Meanings

RETURN VALUES
-1 Your request is incomplete and missing some mandatory parameters.
-2 Incorrect messageId.
-3 Delivery Report Not Available On Given messageId.
-4 The Username or Password you supplied is either invalid or disabled or blocked.
Delivered The message was successfully delivered to the Recipient.
pending Message is being delivered.
Failed Message failed to be delivered.
Deleted Message sent but Deleted before delivery report.
Rejected Message has been rejected, reasons may vary
Canceled Cancel The waiting state of Delivery.
Queued Message is in waiting Queue state.
Unknown Undocumented status from the mobile operator.
-9 Unknown error (contact with Department).
-10 Service Down.

(Note:)
Make sure your logic is not case-sensitive on return response.
If the status is "delivered" . You may get response like "DELIVERED" or "delivered".
If the status is "rejected" . You may get response like "failed" or "rejected".
If the status is not "delivered" . You may get response like "NOT_DELIVERED" or "undelivered".
"accepted" is an intermediate status, the "err-code" is meaningless.
Simple Integration

Below simple HTTP GET / POST METHOD example is given. Please Click on it to check Delivery API interferace

http://Lifetimesms.com/dlvr?username= xxxx &password= xxxx




Pre-built Libraries


Now you can use Lifetimesms's messaging service from your own website. Try our easy to integrate API. We work hard to keep our underlying HTTP API simple, but there are also lots of pre-built libraries for interacting with Stripe. If you write your own library and would like us to link to it, just let us know.


Download Pre-built Libraries Documentation


Plain

< ? php
Include 'Lifetimesms-Messaging.php';
$sms = LifetimeSms_Plain('username',password,'to','from','message');
die ("$sms");
?>

Json

< ? php
Include 'Lifetimesms-Messaging.php';
$sms = LifetimeSms_Json('username',password,'to','from','message');
die ("$sms");
?>


Please Edit php file
Replace "username" and "password" with your own original Login password
Replace "to" with Recepient
Replace "from" with Your Brand
Replace "message" with your on sms for recepient


dlvr.php (For Delivery Reports of Sent SMS)


< ? php
php
Include 'Lifetimesms-Messaging.php';
$sms = LifetimeSms_Dlvr('username',password,'to','from','message');
die ("$sms");
?>


Please Edit dlvr.php
Replace "username" and "password" with your own original Login password
Replace "messageid" with Related SMS




Readymade SMS Sending Script

We are Providing Total solution for sms. Many people have their own website, domains and subdomain . They wanna to send sms from their own website instead of 3rd party website

Please edit index.php add your username and passsword and than upload it in any directory

You can set unlimited password for unlimited users like "abc" for smith and "xyz" for Mudassar


Download Sample sms Sending Script




Our Client

Zindgi PVT LTD Travel Port international Travel Egency Shell Oil Company ProQuest Medical Company Gets Pharma Hobotech Electronics Lipton Tea Dawat Hotel Sitara Branded sms Allied School System xpress Post Al-shifa Hospital Disney Gujrawala Creative Cube Medical PANWORLD Medical Chanan school system Future Scientific Society SMT School and College BMS ISO certification in Karachi MDC Medical diagnostic center LAB Mattanys Restorent Comsats College NgTech Best Colsultantas NACSIT College Platinum.pk Online store of Hands bags Dar-Arqam-School PizzaOne Karachi Food GEHF Housing society of GEPCO IVYFABRICS Flah Trust First Aid Medical Complex Uniquechk shopping mall Al-muzamal JOBS MediaMount Polio Heath Worker Doctors Hospital Lahore Niazi Express Bus Service MGFA Builty Needles Online jewlery Store Hajisons Agricultural Firm Wormwhole Online software house Allied School Royal Group of Industry Milange Shopping Mall Moon Heath Care Center Savour Foods . Food in Karachi Mirchawala School college and accademy AS Projects DeliveryTen Food Delivery GonPacci Resturent A AM Power . Parts of Auto bikes Arain Cargo Trustline Travel Agency