Langkah 1: Daftar & Masuk
- Buka Pendaftaran Pusat Pesan
- Buat akun gratis Anda
- Gunakan kredit gratis Anda untuk menguji dan bermain-main dengan OTP
Langkah 2: Integrasi API (Pengembang, Merakit!)
Kami telah membuat semuanya sangat sederhana. Salin beberapa cuplikan kode dan Anda akan menguji dalam waktu singkat.
Lebih suka mengawasi daripada pengkodean? Kami panduan video cepat Sudahkah Anda menutupi.
Parameter API untuk Verifikasi Sekarang
Parameter berikut perlu dikirim saat menggunakan API VerifyNow.
RCS/ SOUND
URL Dasar API Rest
Semua titik akhir API Platform di bawah ini harus diawali dengan URL berikut:
https://cpaas.messagecentral.comMenghasilkan Token
Saat menggunakan API verifikasi SMS Verify Now untuk mengirim kode verifikasi SMS, panggilan awal harus ke API pembuatan token.
API ini mengembalikan token yang harus disertakan dalam semua panggilan berikutnya. Token otentikasi diperlukan untuk memvalidasi pengguna dan harus dimasukkan dalam bagian header dari setiap permintaan.
Meminta Jalur URL:
/auth/v1/authentication/tokencURL
1curl --location 'https://cpaas.messagecentral.com/auth/v1/authentication/token?
2customerId=%3CCustomerId%3E&key=%3CBase64%20Encrypted%20password%3E&scope=NEW&country=91
3&email=test%40messagecentral.com' \
4--header 'accept: */*'
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
1{
2 "status": Integer,
3 "token": "String"
4}Contoh Kode
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).
Meminta Jalur URL:
Respons yang berhasil akan mengembalikan kode status 200.
/verification/v3/sendParameter URL Minta:
cURL
1curl --location --request POST 'https://cpaas.messagecentral.com/verification/v3/send?
2countryCode=91&flowType=SMS&mobileNumber=9999999999' \
3--header 'authToken:
4eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDIGNzQwNCI6ImIhdCI6MTcxMjExOTA0MCwiZXhwIjo'
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. Anda dapat mengubah basis FlowType saluran pilihan Anda.
Tanggapan JSON
1{
2 "responseCode": 200,
3 "message": "SUCCESS",
4 "data": {
5 "verificationId": "xxxx",
6 "mobileNumber": "xxxx",
7 "responseCode": "200",
8 "errorMessage": null,
9 "timeout": "60",
10 "smCLI": null,
11 "transactionId": "xxxx"
12 }
13}Contoh Kode
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/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999")
.method("POST", body)
.addHeader("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw")
.build();
Response response = client.newCall(request).execute();
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999',
'headers': {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw'
}
};
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/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'authToken' => 'eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw'
));
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/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999"
payload = {}
headers = {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)require "uri"
require "net/http"
url = URI("https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authToken"] = "eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw"
response = https.request(request)
puts response.read_bodyvar client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999");
request.Headers.Add("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());Validasi OTP
Metode validateOTP adalah titik akhir REST API untuk memvalidasi kata sandi satu kali (OTP) untuk pelanggan.
Meminta Jalur URL:
Respons yang berhasil akan mengembalikan kode status 200.
/verification/v3/validateOtp/- Untuk dukungan beberapa bahasa
- secara default adalah bahasa Inggris
- Untuk saat ini kami hanya mendukung bahasa Inggris
cURL
1curl --location 'https://cpaas.messagecentral.com/verification/v3/validateOtp?
2&verificationId=2949&code=1476' \
3--header 'authToken:
4eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDIGNzQwNCI6ImIhdCI6MTcxMjExOTA0MC'
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
Respons yang berhasil akan mengembalikan kode status 200.
1{
2 "responseCode": 200,
3 "message": "SUCCESS",
4 "data": {
5 "verficationId": "xxxx",
6 "mobileNumber": "xxxx",
7 "responseCode": "200",
8 "errorMessage": null,
9 "verificationStatus": "VERIFICATION_COMPLETED",
10 "authToken": null,
11 "transactionId": "xxxx"
12 }
13}Contoh Kode
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/verification/v3/validateOtp?&verificationId=2949&code=1476")
.method("GET", body)
.addHeader("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOT")
.build();
Response response = client.newCall(request).execute();var request = require('request');
var options = {
'method': 'GET',
'url': 'https://cpaas.messagecentral.com/verification/v3/validateOtp?&verificationId=2949&code=1476',
'headers': {
'authToken': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOT'
}
};
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/verification/v3/validateOtp?&verificationId=2949&code=1476');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'authToken' => 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOT'
));
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();
}var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://cpaas.messagecentral.com/verification/v3/validateOtp?&verificationId=2949&code=1476");
request.Headers.Add("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOT");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
require "uri"
require "net/http"
url = URI("https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authToken"] = "eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw"
response = https.request(request)
puts response.read_bodyvar client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://cpaas.messagecentral.com/verification/v3/send?countryCode=91&flowType=SMS&mobileNumber=9999999999");
request.Headers.Add("authToken", "eyJhbGciOiJIUzUxMiJ9.eyJzdWOiJDLTMzNDMyQTVGNDlGNzQwNCIsImlhdCI6MTcxMjExOTA0MCwiZXhw");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());Kode Respon
Bantuan dan Dukungan
Butuh bantuan? Pakar kami tersedia 24/7 untuk memandu Anda melalui apa pun, kapan saja.
Email dukungan: support@messagecentral.com
Pertanyaan yang Sering Diajukan
1. Bagaimana cara mengintegrasikan VerifyNow OTP API dengan kode khusus?
Anda dapat dengan mudah mengintegrasikan an SMS OTP API provider that offers direct operator routes, regional carrier peering, automated retry/fallback, and measurable delivery SLAs. Best-in-class providers also support DLT compliance, delivery receipts (DLR), low-latency routing, and SMS + WhatsApp fallback. Evaluate by measuring real-world delivery rates, average latency (ms), and error breakdowns across major Indian carriers (Jio, Airtel, Vi).
How fast should OTP delivery be for Indian apps, and what impacts latency?
Anda harus memastikan bahwa URL titik akhir untuk Token API cocok dengan yang ditentukan dalam dokumentasi. Hal yang sama telah disebutkan di bawah ini:sub-2 seconds delivery for best UX (under 5s acceptable). Latency is affected by carrier routing, queueing during peak traffic, network congestion, SMS aggregator hops, and DLT/template delays. Use direct routes, parallel routing, and in-built SMS + WhatsApp fallback to minimise end-to-end OTP latency and boost completion rates.
How do I integrate an SMS OTP API into my app in India (Node.js, Python, PHP, Java)?
Anda dapat menguji semua API verifikasi OTP dan SMS VerifyNow menggunakan OTP Verification SDKs. Example (pseudo):
Node.js (fetch):
await fetch('https://api.provider/send', {
method:'POST',
headers:{'Authorization':'Bearer KEY','Content-Type':'application/json'},
body: JSON.stringify({to:'+91XXXXXXXXXX', template:'OTP {{code}}',
variables:{code:123456}}) });
Use HTTPS, HMAC/signing, retries, and webhooks for delivery receipts (DLR).
How do I prevent OTP resend abuse or brute-force attempts in my authentication flow?
Ini biasanya berarti ada masalah dengan paket permintaan atau pengaturan lingkungan Anda. Alasan umum meliputi:
- Badan API atau nilai placeholder salah
- Struktur CURL yang salah atau header yang hilang
- Menggunakan titik akhir pementasan alih-alih produksi
- Lock account or require secondary verification after N failed attempts. Log attempts and notify security teams.
5. Mengapa saya mendapatkan Kode Kesalahan 401 (Tidak Sah)?
Kesalahan
How do I test OTP APIs in sandbox mode without sending real SMS?
Kesalahan
How do I implement rate limiting and retry logic for OTP delivery?
Anda dapat menghasilkan
8. Di mana saya harus menggunakan AuthToken di API VerifyNow?
Yang dihasilkan India requires numeric Sender IDs via DLT-approved routes for most transactional flows; alphanumeric is generally not allowed for OTPs. OTPs must follow telecom/DLT rules. Use a compliant provider that manages DLT registration and numeric Sender ID setup for you.
What is the recommended OTP expiry time and retry cycle for Indian users?
Saat membuat AuthToken, perbarui bidang berikut:3–5 minutes is standard for transactional OTPs (2FA). Retry cycle: allow 1–2 immediate resends with anti-abuse limits (e.g., max 3 sends per 10–15 minutes). Short expiries reduce fraud; sensible resend limits reduce support load and operator filtering.
What is the difference between Transactional vs Service Implicit OTP routes?
Transactional routes are for critical, expected messages (OTP, order updates) that follow stricter compliance and usually have higher delivery priority. Service Implicit (or other service routes) can vary by operator and often apply different template/consent rules. Check your provider’s routing docs — choose transactional routes for OTPs to maximise deliverability and compliance.
How do I migrate from another SMS provider to a new OTP API with zero downtime?
Plan a phased cutover:
- Configure new provider and provision DLT/templates in parallel.
- Mirror traffic (send test batches) and verify delivery metrics.
- Implement dual-sending for a small percentage of live traffic (A/B), monitor results.
- Gradually shift traffic while keeping old provider as fallback.
- Update DNS/webhook endpoints, revoke old keys once stable. Monitor logs and delivery rates closely.
