Lenguaje "Jquery"
Enviar mensajes – REST API – JSON
[js]
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.labsmobile.com/json/send",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic " + btoa("myusername:mypassword"),
"Cache-Control": "no-cache",
},
"processData": false,
"data": "{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}"
}
$.ajax(settings).done(function (response) {
console.log(response);
});
[/js]Consulta de créditos – REST API – JSON
[js]
var settings = {
"async": true,
"crossDomain": true,
"url": "https://api.labsmobile.com/json/balance",
"method": "GET",
"headers": {
"Authorization": "Basic " + btoa("myusername:mypassword"),
"Cache-Control": "no-cache",
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
[/js]Enviar mensajes – HTTP/GET
[js]
$.get(
"http://api.labsmobile.com/get/send.php",
{username : '[X]', password : '[X]', msisdn : '34609036253', sender : 'SENDER', message : 'This is the message'},
function(data) {
alert('page content: ' + data);
}
);
[/js]Consulta de créditos – HTTP/GET
[js]
$.get(
"http://api.labsmobile.com/get/balance.php",
{username : '[X]', password : '[X]'},
function(data) {
alert('page content: ' + data);
}
);
[/js]