Example code for SMS integration in language Javascript

Send SMS - REST API - JSON

            
var data = JSON.stringify({
  "message": "Text of the SMS message",
  "tpoa": "Sender",
  "recipient": [
    {
      "msisdn": "12015550123"
    },
    {
      "msisdn": "447400123456"
    },
    {
      "msisdn": "5212221234567"
    }
  ]
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.labsmobile.com/json/send");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Basic " + btoa("myusername:mypassword"));
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);

Credit inquiry - REST API - JSON

            
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.labsmobile.com/json/balance");
xhr.setRequestHeader("Authorization", "Basic " + btoa("myusername:mypassword"));
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);

Send SMS - HTTP/GET

                
function httpGet(theUrl)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    xmlHttp.send( null );
    return xmlHttp.responseText;
}
httpGet("http://api.labsmobile.com/get/send.php?username=[X]&password=[X]&msisdn=34609036253&sender=SENDER&message=This+is+the+message");

Credit inquiry - HTTP/GET

                
function httpGet(theUrl)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false );
    xmlHttp.send( null );
    return xmlHttp.responseText;
}
httpGet("http://api.labsmobile.com/get/balance.php?username=[X]&password=[X]");
  • contact form support

    Sign up!

    Create a user account and send your SMS messages in seconds. You will have all the functionalities and benefits in the same platform.

    Send from API and manage your account with our online application WebSMS.

    Create new account
  • DentalCare, Software for dental surgeries recommends LabsMobile

    SMS communication for dental surgeries. Reminders, loyalty programs, commercial and bulk marketing campaigns.

    Watch more reviews
  • dashboard aplicación online

    Maximum reliability at the best price

    At LabsMobile we only offer direct routes of maximum reliability and quality. Enjoy our platform and all our services for the price of an SMS.

    Pay ONLY for sent messages.

    Check our rates
  • dashboard aplicación online

    Need more info? Contact us!

    Our technical department has professionals with years of experience and we have made multiple integrations.

    We guide and help you through the process.

    Request technical support
  • Integrate your application with our API

    This tutorial will explain how to initiate the integration of any application or software with the LabsMobile platform for SMS communication.

    Ir al tutorial
loader