Send SMS (Advanced) Multiple Single
https://api.loftysms.com/v2/send/sms
This API allows you to send multiple single bulk sms. To learn how to generate your access token click here
Parameters
Field | Required | Description |
---|---|---|
data | true | Your Data is expected to be an array of JSON parameters. The parameters required inside each is sender, recipient and message |
corporate | true | This instructs our platform to attempt to use corporate route to submit messages in case the messages were rejected because of Do not disturb. |
Any parameter within curly braces in the URL must be changed to what it describes
Example Code for Send SMS (Advanced) Multiple Single
curl -k -H "Content-Type: application/json"\
-X -d '{"field1":"abc","field2":"abc"}' POST 'https://api.loftysms.com/v2/send/sms'
var jsondata = {"field1": "xyz","field2": "abc"};
var settings = {
"async": true,
"crossDomain": true,
"url": https://api.loftysms.com/v2/send/sms,
"method": POST,
"headers": {
"content-type": "application/json",
"cache-control": "no-cache"
},"processData": false,
"data": JSON.stringify(jsondata)
}
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require("request");
var options = {
method: POST,
url: https://api.loftysms.com/v2/send/sms,
headers:
{ 'cache-control': 'no-cache',
},
"body": { field1: "xyz", field2: "abc" },
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
HttpResponse
response = Unirest.post("https://api.loftysms.com/v2/send/sms")
.header("cache-control", "no-cache")
.body("{"field1":"xyz","field2":"abc"}").asString();
$request = new HttpRequest();
$request->setUrl('https://api.loftysms.com/v2/send/sms');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache','content-type' => 'application/json'
));
$request->setBody("{"field1":"xyz","field2":"abc"}");
}}
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}