API Documentation

  • Home
  • Getting Started

SMS API

  • Overview
  • Send SMS
  • Bulk SMS
  • Send Hashed SMS
  • Send OTP
  • Delivery Reports
  • Delivery Status
  • SMS Balance
  • Common Errors
  • Response Codes

Send Bulk SMS

The Send Bulk API allows you to send up to 1000 unique messages in a single request. Each message can have a different recipient and message content.

Info: The partnerID, apikey, and shortcode should be the same for all JSON objects within the smslist array. Any mismatch will default to using credentials in the first object.

POST Method

Endpoint

https://send.macrologicsys.com/api/services/sendbulk

Request Body

{
    "count": {{count}},
    "smslist": [
        {
            "partnerID": "{{partnerID}}",
            "apikey": "{{apikey}}",
            "pass_type": "plain",
            "clientsmsid": {{clientsmsid1}},
            "mobile": "{{mobile1}}",
            "message": "{{message1}}",
            "shortcode": "{{shortcode}}"
        },
        {
            "partnerID": "{{partnerID}}",
            "apikey": "{{apikey}}",
            "pass_type": "plain",
            "mobile": "{{mobile2}}",
            "clientsmsid": {{clientsmsid2}},
            "message": "{{message2}}",
            "shortcode": "{{shortcode}}",
            "pass_type": "{{pass_type}}"
        }
    ]
}

Sample Success Response

{
    "responses": [
        {
            "response-code": 200,
            "response-description": "Success",
            "mobile": "xxxxxxxx",
            "messageid": "xxxxxxxx",
            "clientsmsid": 1234,
            "networkid": 1
        },
        {
            "response-code": 200,
            "response-description": "Success",
            "mobile": "xxxxxxxx",
            "messageid": "xxxxxxxx",
            "clientsmsid": 1234,
            "networkid": 1
        }
    ]
}

Sample Error Response

{
    "response-code": 1006,
    "response-description": "Invalid credentials"
}

Code Examples

PHP

<?php
$payload = json_encode([
    "count" => {{count}},
    "smslist" => [
        [
            "partnerID" => "{{partnerID}}",
            "apikey" => "{{apikey}}",
            "pass_type" => "plain",
            "clientsmsid" => {{clientsmsid1}},
            "mobile" => "{{mobile1}}",
            "message" => "{{message1}}",
            "shortcode" => "{{shortcode}}"
        ],
        [
            "partnerID" => "{{partnerID}}",
            "apikey" => "{{apikey}}",
            "pass_type" => "plain",
            "mobile" => "{{mobile2}}",
            "clientsmsid" => {{clientsmsid2}},
            "message" => "{{message2}}",
            "shortcode" => "{{shortcode}}",
            "pass_type" => "{{pass_type}}"
        ]
    ]
]);

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => "https://send.macrologicsys.com/api/services/sendbulk",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $payload,
    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({
  "count": {{count}},
  "smslist": [
    {
      "partnerID": "{{partnerID}}",
      "apikey": "{{apikey}}",
      "pass_type": "plain",
      "clientsmsid": {{clientsmsid1}},
      "mobile": "{{mobile1}}",
      "message": "{{message1}}",
      "shortcode": "{{shortcode}}"
    },
    {
      "partnerID": "{{partnerID}}",
      "apikey": "{{apikey}}",
      "pass_type": "plain",
      "mobile": "{{mobile2}}",
      "clientsmsid": {{clientsmsid2}},
      "message": "{{message2}}",
      "shortcode": "{{shortcode}}"
    }
  ]
});

const options = {
  hostname: 'send.macrologicsys.com',
  path: '/api/services/sendbulk',
  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/sendbulk"

payload = {
    "count": {{count}},
    "smslist": [
        {
            "partnerID": "{{partnerID}}",
            "apikey": "{{apikey}}",
            "pass_type": "plain",
            "clientsmsid": {{clientsmsid1}},
            "mobile": "{{mobile1}}",
            "message": "{{message1}}",
            "shortcode": "{{shortcode}}"
        },
        {
            "partnerID": "{{partnerID}}",
            "apikey": "{{apikey}}",
            "pass_type": "plain",
            "mobile": "{{mobile2}}",
            "clientsmsid": {{clientsmsid2}},
            "message": "{{message2}}",
            "shortcode": "{{shortcode}}"
        }
    ]
}

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

Related Endpoints

  • Send SMS
  • Send Hashed SMS
  • Response Codes

© 2025 All rights reserved | info@macrologicsys.com