API

Use our SMS Gateway API

Connect your application with our API and start sending SMS today. Easily SMS-enable your website, application or customer relationship management platform with our REST API.

View Our PricingAPI Documentation

User-friendly Documentation

We offer comprehensive documentation that is easy to access and includes code samples. Our API supports Unicode
and long messages, and allows for multiple web hooks to create and customize any workflow.

SMS Messaging API

You can use PROSMS’s HTTP SMS API to send SMS to anywhere in the Pakistan.

Api2

HOW TO SEND SMS MESSAGES WITH PROSMS’S SMS API?

  • Make HTTPS request to SMS Messaging API.
  • Check the response code and store returned Transaction ID to match DLR later.
  • SMS is sent to the handset.
  • Handset responds with Delivery Report (DLR).
  • If DLR callback URL was configured in API Settings, PROSMS forwards the DLR to you with the same Transaction ID.

Getting Started

Setup is quick, easy and free. You can be sending SMS messages in just a few minutes!

StringRequest registerRequest = new StringRequest(Request.Method.POST, "https://cp.prosms.pk/api/quick/message",
    new Response.Listener() {
        @Override
        public void onResponse(String response) {
            pDialog.dismiss();
            try {
                JSONObject object = new JSONObject(response);
                Log.d("Response from API", "onResponse: " + response);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    },
    new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            new VolleyErrorManager(error, mContext,"Exception: ");
        }
    }
) {
    @Override
    protected Map getParams() {
        Map  params = new HashMap();
        params.put("user", "username");
        params.put("password", "secret");
        params.put("to", "923123456789");
        params.put("mask", "Pro SMS");
        params.put("message", "Your message");

        return params;
    }
};
var Request = require("request");

Request.post({
    "headers": { "content-type": "application/json" },
    "url": "https://cp.prosms.pk/api/quick/message",
    "body": JSON.stringify({
        "user": "username", "password": "secret", "to": "923123456789", "mask": "Pro SMS", "message": "Your message"
    })
}, (error, response, body) => {
    if(error) {
        return console.dir(error);
    }
    console.dir(JSON.parse(body));
});
let params = ["user": "username", "password": "secret", "to": "923123456789", "mask": "Pro SMS", "message": "Your message"] as Dictionary

var request = URLRequest(url: URL(string: "https://cp.prosms.pk/api/quick/message")!)
request.httpMethod = "POST"
request.httpBody = try? JSONSerialization.data(withJSONObject: params, options: [])
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

let session = URLSession.shared
let task = session.dataTask(with: request, completionHandler: { data, response, error -> Void in
    do {
        let json = try JSONSerialization.jsonObject(with: data!) as! Dictionary
        print(json)
    } catch {
        print("error")
    }
})
task.resume()
using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace HttpClientSample
{
    public class Message
    {
        public string user { get; set; }
        public string password { get; set; }
        public int to { get; set; }
        public string mask { get; set; }
        public string message { get; set; }
    }

    class Program
    {
        static HttpClient client = new HttpClient();

        static async Task CreateMessageAsync(Message message)
        {
            HttpResponseMessage response = await client.PostAsJsonAsync(
                "api/quick/message", message);
            response.EnsureSuccessStatusCode();
            return response.Headers.Location;
        }

        static async Task SendMessageAsync(string path)
        {
            Message message = null;
            HttpResponseMessage response = await client.GetAsync(path);
            if (response.IsSuccessStatusCode)
            {
                message = await response.Content.ReadAsStringAsync();
            }
            return message;
        }
                                            static void Main()
        {
            RunAsync().GetAwaiter().GetResult();
        }

        static async Task RunAsync()
        {
            client.BaseAddress = new Uri("https://cp.prosms.pk/");
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(
            new MediaTypeWithQualityHeaderValue("application/json"));

            try {
                Message message = new Message
                {
                    user = "username",
                    password = "secret",
                    to = "923123456789",
                    mask = "Pro SMS",
                    message = "Your Message"
                };
                var url = await CreateMessageAsync(message);
                Console.WriteLine($"Created at {url}");

                message = await GetProductAsync(url.PathAndQuery);
                Console.WriteLine(message);
            }
            catch (Exception e) {
                Console.WriteLine(e.Message);
            }
            Console.ReadLine();
        }
    }
}
import requests
payload = {'user': 'username', 'password': 'secret', 'to': '923123456789', 'mask': 'Pro SMS', 'message': 'Your message'}
r = requests.get('https://cp.prosms.pk/api/quick/message', params=payload)
r.text
function httpPost($url,$params)
{
    $postData = '';
    foreach($params as $k => $v) {
        $postData .= $k . '='.$v.'&';
    }
    $postData = rtrim($postData, '&');

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($ch,CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_POST, count($postData));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
    $output = curl_exec($ch);
    curl_close($ch);
    return $output;
}

$url = "https://cp.prosms.pk/api/quick/message";
$params = [
    "user" => "username",
    "password" => "password",
    "mask" => "Pro SMS",
    "to" => "923123456789",
    "message" => "Your Message",
];
httpPost($url,$params);
Need Help? Chat with us