SMS API Documentation

Version – 1.0
info

Please note that you will need our team’s help to start your SMS campaigns even after API integration. So, request you to get in touch after integration.

Introduction

Message Now is a versatile messaging API designed to facilitate the sending of messages over SMS and RCS.

Help & Support

For implementation support and any feedback, please reach out to us at: support@messagecentral.com

API Parameter for Message Now

API Parameter
Type
Value
flowType
String
SMS/WHATSAPP/
RCS/SAUTH
type
String
OTP

Message Sending Modes

Message Central offers two primary modes for sending messages through the Message Now API:

  1. Send a Message to a Single Number

    • To send a message to a single number, populate the following API fields:

    • MobileNumber: The recipient's mobile number.

    • Message: The text content of the message to be sent.

  2. Send a Message to Multiple Numbers 


    There are two methods to send messages to multiple numbers:

a. Using Multipart File Upload

  • File Upload: Use the API parameter (file)to upload a multipart file.

  • Message: Use the API parameter (message)for the text to be sent.

  • File Format: Only .xlsx files are supported.

  • Customization: This method supports customized messages per user, allowing different message content for each recipient listed in the file.

b. Using API Field for Multiple Numbers

  • PhoneNumbers: Use the API parameter (phoneNumbers)to specify the list of recipient numbers.(format: country <space> mobile : Eg - 91 9816111111, 91 7715131105,.....………….)

  • Message: Use the API parameter (message)for the text to be sent.

  • File Format: Only .xlsx files are supported.

  • Customization: This method supports customized messages per user, allowing different message content for each recipient listed in the file.

Difference Between Multipart File Upload and Phone Numbers Field:

  • Multipart File Upload (.xlsx): Allows for customized messages per user. Each recipient can receive a unique message as specified in the uploaded .xlsx file.

  • PhoneNumbers Field: Sends the same text to all recipients. The message specified in the message field will be uniformly delivered to everyone listed in the phoneNumbers field.

Please find the Sample file format in XLXS format below:

Country
Mobile
Var1
Var2
Var3
91
12345678901
Amit
$35
DISOUNT20
91
23456789012
Kunal
$60
DISOUNT20
91
12345678901
Prakash
$35
DISOUNT20

Where ‘var1’, ‘var2’, and ‘var3’ are placeholders for variables.

If an enterprise wants to send a customized message using file upload,the message field should be formatted as follows:

Sample message - “Hello ##var##, your balance is ##var2## on date ##var3##

Grab the Opportunity

If you are a developer or a web development agency, partner with us to accelerate your earnings.

Become a Partner
css-image

Send SMS

Request Header
Type
Mandatory?
authToken
String
SMS/WHATSAPP/
RCS/SAUTH

To send an SMS to a mobile number, the following request parameters are required. An authentication token, generated by the token generation API, is necessary to send the SMS.

https://cpaas.messagecentral.com

When using  Verify Now’s SMS verification  API to send SMS verification codes, the initial call should be to the token generation API.

This API returns a token that must be included in all subsequent calls. An authentication token is needed to validate the user and should be included in the header section of each request.

Field
Type
Mandatory?
Description
customerId
String
yes
Customer identifier (need to signup to get your  customer id)
country
String
no
Country code to send OTP to
email
String
no
Email
key
String
String
Base-64 encrypted password
scope
String
no
Use ‘NEW’ for first time

Request URL Path:

A successful response will return a 200 status code.

/verification/v3/send

Request Parameters:

A successful response will return a 200 status code.

Field
Type
Mandatory?
Description
type
String
yes
Use “SMS” while sending SMS
file
xlxs
no
This needs to be sent as form data
countryCode
String
Yes (in case of single SMS & Verify Now)
CountryCode
otpLength
Integer
No
Base-64 encrypted password
mobileNumber
String
Yes (in case of single SMS)
Mobile number for single text
flowType
String
Yes
Send “SMS”
messageType
String
No (default is OTP)
The type of message to be sent (Allowed values are TRANSACTION, PROMOTIONAL, OTP)
senderId
String
Yes (in case of SMS)
ID of the sender
phoneNumbers
String
No
A list of phone numbers to send the SMS (format: country <space>mobile : 
91  9876111111)
message
String
No
The custom message to be sent
templateId
String
No
Template Id of your approved template
entityId
String
No
Entity Id of your brand

NOTE: TemplateID and EntityID are required ifthe template is notregistered with Message Central. Also, both templateId and entityId must be present or both must be absent.

cURL

1curl --location --request POST 'https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowT ype=SMS&mobileNumber=9999999999&senderId=UTOMOB&type=SMS&message=%3CYour%20 Message%20Template%3E&messageType=PROMOTIONAL' \--header 'authToken: eyJhbGciOiJIUzUxMiJ9.thisisatesttoken.IgGu7Sb4lovBSql5LIXZU3jlwPG4giAMZ2kTI Mg_EAaKVsVcCdpW_TYzyzdTd94GdEJMt5WntEGcEX4w0hITng'

NOTE: To convert a cURL command into code using Postman, open Postman, import the cURL command via the "Import" button, and then generate the code in your preferred language by clicking the "Code" button on the right side ofthe request.

Response JSON

A successful response will return a 200 status code.

1{
2	"responseCode": 200,
3	"message": "SUCCESS",
4	"data": {
5		"verificationId": "1234",
6		"mobileNumber": "9999999999",
7		"responseCode": "200",
8		"errorMessage": null,
9		"timeout": "30.0",
10		"smsCLI": null,
11		"transactionId": "1c9c56ec-5cd3-48b5-9e32-a15499fb77a2"
12	}
13}

Example Codes

curl --location 'https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999&senderId=UTOMOB&type=SMS&message=%3CYour%20Message%20Template%3E&messageType=PROMOTIONAL' \
--header 'authToken: eyJhbGciOiJIUzUxMiJ9.thisisatesttoken.IgGu7Sb4lovBSql5LIXZU3jlwPG4giAMZ2kTIMg_EAaKVsVcCdpW_TYzyzdTd94GdEJMt5WntEGcEX4w0hITng' \
--form 'file=@"/C:/Users/Kunal Suryawanshi/Downloads/Sample_MessageNow.xlsx"'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com")
  .method("GET", body)
  .addHeader("accept", "*/*")
  .build();
Response response = client.newCall(request).execute();
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com',
  'headers': {
    'accept': '*/*'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'accept' => '*/*'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
import requests

url = "https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com"

payload = {}
headers = {
  'accept': '*/*'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
require "uri"
require "net/http"

url = URI("https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["accept"] = "*/*"

response = https.request(request)
puts response.read_body

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://cpaas.messagecentral.com/auth/v1/authentication/token?customerId=<CustomerId>&key=<Base64 Encrypted password>&scope=NEW&country=91&email=test@messagecentral.com");
request.Headers.Add("accept", "*/*");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

SMS Callback Integration with Message Central

To receive SMS callbacks and maintain them on your own system for receiving status updates of all messages sentthrough our service, please follow these steps:

1. Information Required:
a. Customer ID
b .Brand Name
c. Registered Email ID
d. Callback URL

2. Submission Instructions: Please send the above information to operations@messagecentral.com with the subject line "SMS Callback Integration with Message Central.

3. Callback URL Specifications: Ensure your callback URL is accessible and capable of receiving HTTP POST requests containing JSON payloads with status updates of sent SMS messages. Upon triggering,the endpoint will receive the following JSON payload.

1{ 
2"apiKey": null, 
3"clientId": null, 
4"messageId": "a2e87214-d18c-4a2e-b7f4-802c4465a9b9", 
5"status": "DELIVRD", 
6"errorCode": 0, 
7"countryCode": null, 
8"mobile": "919999999999", 
9"submitDate": "2023-11-02 13:59:18", 
10"doneDate": "2023-11-02 13:59:22" 
11}

4. Standard Status: These are the following status you will receive for all the messages sent.
a. DELIVRD 

b. EXPIRED
c. UNDELIV
d. UNKNOWN
e. REJECTD

For further assistance or clarification, please contact our support team at:-support@messagecentral.com

How do I authenticate requests to the SMS API?

SMS API requests are authenticated using API credentials, typically an API key or token passed in the request header or parameters. Authentication ensures only authorized applications can send SMS messages and access delivery reports. Credentials are generated in the dashboard and should be kept secure.

What request format does the SMS API use?

Most SMS APIs use a REST-based request format over HTTPS. Requests are usually sent as HTTP POST calls with parameters formatted in JSON or URL-encoded form. This makes these Bulk SMS APIs easy to integrate with web and mobile applications.

What parameters are required to send an SMS using the API?

To send an SMS using an API or SMS Gateway, required parameters typically include the recipient phone number, message content, sender ID, and authentication credentials. Some APIs also require a message type, such as transactional SMS or promotional SMS.

How do I send an OTP using the SMS API?

You can send an OTP using the SMS API by passing the recipient number, OTP message content, and message type as parameters in an API request. The API generates a message ID, allowing applications to track delivery and verify the OTP during user authentication.

How do I send bulk SMS using the SMS API?

Bulk SMS can be sent using an SMS API by submitting multiple recipient numbers in a single request or by uploading a batch payload. The API processes messages asynchronously and provides delivery reports for each recipient.

How do I check SMS delivery status using the API?

SMS delivery status can be checked using the message ID returned by the API. Applications can query a delivery report endpoint or receive delivery updates through callbacks or webhooks configured during API integration.

Does the SMS API support webhooks or callbacks?

Yes. Most SMS APIs support webhooks or callbacks that notify your application when a message is delivered, failed, or expired. Callbacks allow real-time delivery tracking without polling the API repeatedly.

What delivery statuses does the SMS API return?

An SMS API typically returns delivery statuses such as queued, sent, delivered, failed, or expired. These statuses help applications monitor message progress and take action when delivery issues occur.

What error codes does the SMS API return?

SMS APIs return standardized error codes for issues such as authentication failure, invalid numbers, insufficient balance, or blocked routes. Each error code is accompanied by a description to help developers debug and handle failures programmatically.

Is the SMS API rate-limited?

Yes. SMS APIs usually enforce rate limits to prevent abuse and ensure system stability. Rate limits define how many requests an application can make within a given time window and may vary based on account type or usage level.

Ready to get started?

Safeguard your user accounts and build trust with your customers using SMS verification. Try Verify Now without any credit card.

+17178379132
phone-callphone-call