Dokumentasi API Verifikasi SMS

Versi - 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

Parameter API untuk Verifikasi Sekarang

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

URL Dasar API Rest

Semua titik akhir API Platform di bawah ini harus diawali dengan URL berikut:

  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##

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'

CATATAN: Untuk mengubah perintah cURL menjadi kode menggunakan Postman, buka Postman, impor perintah cURL melalui tombol “Impor”, lalu buat kode dalam bahasa pilihan Anda dengan mengklik tombol “Kode” di sisi kanan permintaan.

Tanggapan 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());

Kirim OTP

Untuk SendOTP pada nomor ponsel di bawah ini adalah parameter permintaan. Token otentikasi diperlukan untuk mengirim OTP yang dihasilkan oleh token API yang dihasilkan (yang dapat Anda temukan di atas di bagian Pendahuluan).

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

Siap untuk memulai?

Lindungi akun pengguna Anda dan bangun kepercayaan dengan pelanggan Anda menggunakan verifikasi SMS. Coba Verifikasi Sekarang tanpa kartu kredit.

Message Central Logo Blue
Close Icon
Tim Pusat Pesan
Halo
Bagaimana kami bisa membantu Anda hari ini?
WhatsApp Icon
Mulai Obrolan Whatsapp
WhatsApp Chat
WhatsApp Icon