Send SMS
The Send SMS API allows you to send SMS messages to recipients using your assigned shortcode. It supports sending a message to a single number via GET and to one or multiple numbers via POST. For multiple numbers, provide them as a comma-separated string (maximum 1000 numbers per request).
Tip: To schedule messages add
timeToSend in the POST request with a valid
date string that resolves to a Unix timestamp or the
unix timestamp itself. For example "2019-09-01 18:00"
GET Method
Endpoint
https://send.macrologicsys.com/api/services/sendsms
Parameters
| Parameter | Description |
|---|---|
apikey |
Your valid API key |
partnerID |
Your Partner ID |
message |
URL-encoded message (GSM7) |
shortcode |
Sender ID/Shortcode |
mobile |
Recipient Mobile number |
timeToSend |
Optional param for scheduling |
Example Request (GET)
https://send.macrologicsys.com/api/services/sendsms?apikey={{apikey}}&partnerID={{partnerID}}&message={{message}}&shortcode={{shortcode}}&mobile={{mobile}}
POST Method
Endpoint
https://send.macrologicsys.com/api/services/sendsms
Request Body
{
"apikey": "{{apikey}}",
"partnerID": "{{partnerID}}",
"message": "{{message}}",
"shortcode": "{{shortcode}}",
"mobile": "{{mobile}}"
}
Sample Success Response
{
"responses":[
{
"response-code": 200,
"response-description": "Success",
"mobile": "xxxxxxxxxxxxx",
"messageid": "xxxxxxxxxxx",
"networkid": 1
}
]
}
Sample Error Response
{
"response-code": 1006,
"response-description": "Invalid credentials"
}
Code Examples
PHP (GET Request)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://send.macrologicsys.com/api/services/sendsms?apikey={{apikey}}&partnerID={{partnerID}}&message={{message}}&shortcode={{shortcode}}&mobile={{mobile}}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET"
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
PHP (POST Request)
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://send.macrologicsys.com/api/services/sendsms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"apikey" => "{{apikey}}",
"partnerID" => "{{partnerID}}",
"message" => "{{message}}",
"shortcode" => "{{shortcode}}",
"mobile" => "{{mobile}}"
]),
CURLOPT_HTTPHEADER => ['Content-Type: application/json']
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Node.js
const https = require('https');
const data = JSON.stringify({
"apikey": "{{apikey}}",
"partnerID": "{{partnerID}}",
"message": "{{message}}",
"shortcode": "{{shortcode}}",
"mobile": "{{mobile}}"
});
const options = {
hostname: 'send.macrologicsys.com',
path: '/api/services/sendsms',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(JSON.parse(responseData));
});
});
req.on('error', (error) => {
console.error(error);
});
req.write(data);
req.end();
Python
import requests
import json
url = "https://send.macrologicsys.com/api/services/sendsms"
payload = {
"apikey": "{{apikey}}",
"partnerID": "{{partnerID}}",
"message": "{{message}}",
"shortcode": "{{shortcode}}",
"mobile": "{{mobile}}"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())
Last Updated: 2/24/2025, 12:29:27 PM | Contributors: Macrologic API Team