Integrate with Our Seamless APIs

Easily Integrate Any Application With our Secure, Scalable & Powerful SMS APIs.

Getting started

MSMPUSHER provides a number of APIs to allow developers to integrate functionality into their systems. Below are the list of required request parameters:

Key Description
PRIVATEKEY This is your MSMPUSHER business account ID
PUBLICKEY Visit user console to get your test or live API Public key
SENDER The alphanumeric string that represents the name or number of the organization sending the message.
NUMBERS The number you are sending the SMS to in E.164 format. For example 447700900000.
MESSAGE The message to be sent.

NOTE: Don't use a leading + or 00 when entering a phone number, start with the country code, for example 233501723292.

API V1.01

The API allows you to submit and receive MSMPUSHER messages. You can also get access to past messages and see your account profile.

The endpoint to use for this service is https://api.msmpusher.net/v1/send/. The base URL cannot be used on its own; you must append a path that identifies an operation and you may have to specify some path parameters as well.

Authentication

To make successful API requests, you need a verified account on MSMPUSHER and to authorize the API calls using the following methods:

Key Description
PRIVATEKEY This is your MSMPUSHER business account ID
PUBLICKEY Visit user console to get your test or live API Public key

You can generate, retrieve and manage your API Public keys in your MSMPUSHER API Clients page.

Send SMS

POST https://api.msmpusher.net/v1/send

Example of full request
POST /v1/send HTTP/1.1
Host: https://api.msmpusher.net
Content-Type: application/json
Cache-Control: no-cache
{
"privatekey": "<PRIVATEKEY>",
"publickey": "<PUBLICKEY>",
"sender": "MSMPUSHER",
"numbers": "7700900000",
"message": "test_sms",
}

Response to this command may be:

In case of success:
    
     {
        "type": "Message(s) Sent",
        "status": 1000,
        "sms_id": "MSG_TRANS_1603120251942",
        "Receiver_numbers": "447820125799",
        "error": Null,
        "detail": All Messages was sent successfully
        
    }

    
            

In case of error:

{
    "type": "invalid_phone_number",
    "code": 1005,
    "error": "Invalid phone number",
    "detail": null
}
    
                        

Where:

  • type and error (description of the error) can be found in the error types table,
  • code represents http error
  • detail is an additional info about the error

Code Snippets

  • Post
  • Get
/* Account Details */ $privatekey = '2020000000000001'; $publickey = 'xxxxxxxxxxxx';

/* Message Details */ $sender = 'MSM-API'; $numbers = array("233548723292","233241109433"); $message = rawurlencode('This message is sent from the MSMPUSHER API. hurray!'); $numbers = implode(',', $numbers);

$url = 'http://api.msmpusher.net/v1/send';

/* Collection Object */
$data = [
  "privatekey" => $privatekey,
  "publickey" => $publickey,
  "sender" => $sender,
  "numbers" => $numbers,
  "message" => $message
];


/* Initializes a new cURL session */ $curl = curl_init($url);

/* Send the POST request with cURL */ curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

/* Set custom headers Auth and Content-Type header*/
curl_setopt($curl, CURLOPT_HTTPHEADER, [
  "Content-Type: application/json",
  "Accept: application/json"
]);


/* Execute cURL request with all previous settings */ $response = curl_exec($curl);

echo $response;

/* Close cURL session */ curl_close($curl);
/* Account Details */ $privatekey = 'xxxxxxxxxxxxxx'; $publickey = 'xxxxxxxxxxxx';

/* Message Details */ $sender = 'MSM-API'; $numbers = array("918123456789","918987654321"); $message = rawurlencode('This message is sent from the MSMPUSHER API. hurray!'); $numbers = implode(',', $numbers);

/* Message Details */
$data ='privatekey='.$privatekey.'&publickey='.$publickey.'&numbers='.$numbers.'&sender='.$sender.'&message='.$message.'';


/* Send GET request with cURL */ $curl = curl_init('http://api.msmpusher.net/v1/send?'.$data); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl);

/* Process your response here */ echo $response; curl_close($curl);
  • Post
  • Get
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder;
public class sendSMS { public String sendSms() { try { // Construct data String privatekey = "private_key=" + "xxxxxxxxxxxxxx"; String publickey = "public_key=" + "xxxxxxxxxxxxxx"; String message = "&message=" + "This message is sent from the MSMPUSHER API. hurray!"; String sender = "&sender=" + "MSM-API"; String numbers = "&numbers=" + "233548723292,233241109433"; // Send data HttpURLConnection conn = (HttpURLConnection) new URL("https://api.msmpusher.net/v1/send?").openConnection(); String data = private_key + public_key + numbers + message + sender; conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Length", Integer.toString(data.length())); conn.getOutputStream().write(data.getBytes("UTF-8")); final BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); final StringBuffer stringBuffer = new StringBuffer(); String line; while ((line = rd.readLine()) != null) { stringBuffer.append(line);
} rd.close();
return stringBuffer.toString(); } catch (Exception e) { System.out.println("Error SMS "+e); return "Error "+e; } } }
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder;
public class sendSMS { public String sendSms() { try { // Construct data String privatekey = "private_key=" + URLEncoder.encode("xxxxxxxxxxxxxx", "UTF-8"); String publickey = "public_key=" + URLEncoder.encode("xxxxxxxxxxxxxx", "UTF-8"); String message = "&message=" + URLEncoder.encode("This message is sent from the MSMPUSHER API. hurray!", "UTF-8"); String sender = "&sender=" + URLEncoder.encode("MSM-API", "UTF-8"); String numbers = "&numbers=" + URLEncoder.encode("233548723292,233241109433", "UTF-8"); // Send data String data = "https://api.msmpusher.net/v1/send?" + private_key + public_key + numbers + message + sender; URL url = new URL(data); URLConnection conn = url.openConnection(); conn.setDoOutput(true);
// Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; String sResult=""; while ((line = rd.readLine()) != null) { // Process line... sResult=sResult+line+" ";
} rd.close();
return sResult } catch (Exception e) { System.out.println("Error SMS "+e); return "Error "+e; } } }
  • Post
  • Get
import urllib.request import urllib.parse
def sendSMS(privatekey, publickey, numbers, sender, message): data = urllib.parse.urlencode({'privatekey': privatekey,'publickey': publickey, 'numbers': numbers, 'message' : message, 'sender': sender}) data = data.encode('utf-8') request = urllib.request.Request("https://api.msmpusher.net/v1/send?") f = urllib.request.urlopen(request, data) fr = f.read() return(fr)
resp = sendSMS('xxxxxxxxxxxxxx','xxxxxxxxxxxxxx', '233548723292,233241109433', 'MSM-API', 'This message is sent from the MSMPUSHER API. hurray!') print (resp)
import urllib.request import urllib.parse
def sendSMS(privatekey, publickey, numbers, sender, message): params = {'privatekey': privatekey, 'publickey': publickey, 'numbers': numbers, 'message' : message, 'sender': sender} f = urllib.request.urlopen('https://api.msmpusher.net/v1/send?' + urllib.parse.urlencode(params)) return (f.read(), f.code)
resp, code = sendSMS('xxxxxxxxxxxxxx','xxxxxxxxxxxxxx', '233548723292,233241109433', 'MSM-API', 'This message is sent from the MSMPUSHER API. hurray!') print (resp)
  • Post
  • Get
<% privatekey = "xxxxxxxxxxxxxx" publickey = "xxxxxxxxxxxxxx" address = "https://api.msmpusher.net/v1/send?" message = "This message is sent from the MSMPUSHER API. hurray!" message = Server.urlencode(message) numbers = "233548723292,233241109433" sender = "MSM-API" url = address & "privatekey=" & privatekey & "&publickey=" & publickey & "&numbers=" & numbers & "&message=" & message & "&sender=" & sender set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "POST", url, false xmlhttp.send "" msg = xmlhttp.responseText response.write(msg) set xmlhttp = nothing %>
<% privatekey = "xxxxxxxxxxxxxx" publickey = "xxxxxxxxxxxxxx" address = "https://api.msmpusher.net/v1/send?" message = "This message is sent from the MSMPUSHER API. hurray!" message = Server.urlencode(message) numbers = "233548723292,233241109433" sender = "MSM-API" url = address & "privatekey=" & privatekey & "&publickey=" & publickey & "&numbers=" & numbers & "&message=" & message & "&sender=" & sender set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", url, false xmlhttp.send "" msg = xmlhttp.responseText response.write(msg) set xmlhttp = nothing %>
  • Post
  • Get
using System; using System.Collections.Generic; using System.Net; using System.Collections.Specialized; using System.IO;
namespace sendSMS { class sendSMS { public string sendSMS() { String result; string apiKey = "your apiKey"; string numbers = "918123456789"; // in a comma seperated list string message = "This is your message"; string sender = "TXTLCL"; String url = "https://api.textlocal.in/send/?apikey=" + apiKey + "&numbers=" + numbers + "&message=" + message + "&sender=" + sender; //refer to parameters to complete correct url string StreamWriter myWriter = null; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentLength = Encoding.UTF8.GetByteCount(url); objRequest.ContentType = "application/x-www-form-urlencoded"; try { myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.Write(url); } catch (Exception e) { return e.Message; } finally { myWriter.Close(); } HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse(); using (StreamReader sr = new StreamReader(objResponse.GetResponseStream())) { result = sr.ReadToEnd(); // Close and clean up the StreamReader sr.Close(); } return result; } } }

Status Codes

Key Description
1000 All Messages sent successfully
1001 Not All Messages were sent successfully due to insufficient balance
1002 Missing API Parameters
1003 Insufficient balance
1004 Mismatched API key
1005 Invalid Phone Number
1006 invalid Sender ID. Sender ID must not be more than 11 Characters. Characters include white space.
1007 Message scheduled for later delivery
1008 Empty Message
1009 SMS sending failed
1010 No mesages has been sent on the specified dates using the specified api key
Get Started
Back to top