TCASTSMS menyediakan routing SMS untuk SMS One Time Password, SMS Verifikasi, SMS Notifikasi untuk Two Step Verification keamanan Aplikasi Web dan Mobile Apps Anda dimana pada dokumen ini khusus untuk SMS identitas yang muncul dipenerima berupa Nama Perusahaan atau Nama Merek Dagang maksimal 11 huruf.
SMS ini yang muncul di penerima berupa nomor HP GSM Random Indonesia (628xxxx), Anda dapat menggunakan 2 (dua) tipe koneksi yaitu HTTP API dan SMPP Client. Sistem ini juga menyediakan Dashboard untuk melihat status laporan pengiriman SMS dan mendownload Laporan Pengiriman per bulannya dalam format Excel langsung.
Dibawah ini adalah Contoh Script, Dokumentasi HTTP API, dan Screenshoot Dashboard
Contoh Scripts
<?php
function Send_SMS( $to, $text ) {
#example $to=”628xxxxx,628xxxxx”;
// print_r($to);
$to = str_replace(‘ ‘,”,$to);
$from = “”; //Sender ID or SMS Masking Name, if leave blank, it will use default from telco
$username = “xxxxx”; // username anda
$password = “xxxxx”; // password anda
$getUrl = “xxxxx:xxxx/sendsms?”; // ip address atau domain server dan port
$ch = curl_init();
// print_r($ch);
$apiUrl = $getUrl.’username=’.$username.’&password=’.$password.’&type=0&dlr=1&destination=’.$to.’&source=TCASTSMS&message=’.rawurlencode($text);
//print_r($apiUrl);
curl_setopt( $ch, CURLOPT_URL, $apiUrl);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Accept:application/json’
)
);
$response = curl_exec( $ch );
$httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
$responseBody = json_decode( $response, true );
//print_r($response);
if ($response) {
print_r($response);
}
curl_close($ch);
}
$to = “628xxxxx”;//masukkan nomor tujuan
$message = “Test SMS Masking, PHP”;//masukkan isi pesan
//print_r($message);
Send_SMS( $to, $message );
?>
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class SmsMaskingClient {
public static void main(String[] args) {
String tujuan = “6281375153505,628176757676”;
String pesan = “Test sms masking java”;
String type = “0”;
String dlr = “1”;
SmsMaskingClient smsClientRestApi = new SmsMaskingClient();
smsClientRestApi.sendSms(tujuan, pesan, type, dlr);
}
private void sendSms(String to, String content, String type, String dlr) {
String username = “xxxxx”; // username anda
String password = “xxxxx”; // password anda
try {
URL url = new URL(“xxxxxxxxx/sendsms?” // ip address atau domain server dan port
+ “username=” + username
+ “&password=” + password
+ “&type=” + type
+ “&dlr=” + dlr
+ “&destination=” + to.replaceAll(” “,””)
+ “&source=TCASTSMS”
+ “&message=” + URLEncoder.encode(content, “UTF-8”).replaceAll(“\\+”, “%20”));
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod(“GET”);
conn.setRequestProperty(“Accept”, “application/json”);
if (conn.getResponseCode() != 200) {
throw new RuntimeException(“Failed : HTTP Error code : ”
+ conn.getResponseCode());
}
InputStreamReader in = new InputStreamReader(conn.getInputStream());
BufferedReader br = new BufferedReader(in);
String output;
while ((output = br.readLine()) != null) {
System.out.println(output);
}
conn.disconnect();
} catch (Exception e) {
System.out.println(“Exception in SmsRestApiClient:- ” + e);
}
}
}
<!doctype html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<title>Tcast SMS</title>
<script src=”https://code.jquery.com/jquery-1.10.2.js”></script>
</head>
<body>
<div id=”response”></div>
<script>
(function() {
var username = “xxxxx”; // username anda
var password = “xxxxx”; // password anda
var destination = “628xxxxx”; // nomor tujuan dimulai dari 628xxx
var content = “test send sms Masking java script”; // isi sms
var type = “0”;
var dlr = “1”;
var source = “TCASTSMS”; // sender id
var baseUri = “xxxx:xxxx/sendsms?”; // ip address atau domain server dan port
var tcastUri = baseUri +
“username=” + username
+ “&password=” + password
+ “&type=” + type
+ “&dlr=”+ dlr
+ “&destination=” + destination
+ “&source=” + source
+ “&message=” + encodeURIComponent(content);
$.getJSON( tcastUri)
.done(function( data ) {
document.getElementById(“response”).value = data;
});
})();
</script>
</body>
</html>
//Rextester.Program.Main is the entry point for your code. Don’t change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace Rextester
{
public class DataObject
{
public string Name { get; set; }
}
public class Program
{
private const string URL = “xxxx:xxxx/sendsms”; // ip address atau domain server dan port
//private static string urlParameters = System.Web.HttpUtility.UrlEncode(“account=xxxxx&password=xxxx&numbers=628xxxxx&content=TEST123C#”);
public static void Main(string[] args)
{
var username = “xxxxxx”; // username anda
var password = “xxxxxx”; // password anda
var destination = “628xxxxx”; // nomor tujuan diawali dengan 628xxx
var msgContent = “test send sms Masking .Net”;
var type = “0”;
var dlr = “1”;
var source = “TCASTSMS”; // alpha sender id
var baseUri = “xxxx:xxxx/sendsms?”; // ip address atau domain server dan port
var finalUrlParam = “?username=” + username
+ “&password=” + password
+ “&type=” + type
+ “&dlr=”+ dlr
+ “&destination=” + destination
+ “&source=” + source
+ “&message=” + System.Web.HttpUtility.UrlPathEncode(msgContent);
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(URL);
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue(“application/json”));
// Console.WriteLine(“urlParameters {0}”, finalUrlParam);
// List data response.
HttpResponseMessage response = client.GetAsync(finalUrlParam).Result; // Blocking call! Program will wait here until a response is received or a timeout occurs.
if (response.IsSuccessStatusCode)
{
string res = “”;
using (HttpContent content = response.Content)
{
// … Read the string.
Task<string> result = content.ReadAsStringAsync();
res = result.Result;
Console.WriteLine(“{0}”, res);
}
}
else
{
Console.WriteLine(“{0} ({1})”, (int)response.StatusCode, response.ReasonPhrase);
}
//Make any other calls using HttpClient here.
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
}
}
Dokumen HTTP API
Send SMS
http://xxx.xxx.xxx.xxx:xxxx/sendsms?username=username-anda&password=password-anda&type=0&dlr=1&destination=nomor-hp-tujuan&source=AlphaSenderID-Anda&message=isi-pesan-Anda
username: username yang digunakan untuk login web sms masking
password: password yang digunakan untuk login web sms masking
type: tipe sms yang akan dikirimkan berupa pesan masuk ke inbox atau Flash (pesan tdk masuk ke inbox)
dlr: for report status
destination: nomor hp tujuan diawali dengan 62 contoh untuk 083812345678 menjadi 6283812345678
source: nama pengirim berupa sender id
message: pesan sms 160 karakter utk 1 sms
Where Return Values (status sms)
1701 = Success : Sukses terkirim
1702 = Invalid URL Error
1703 = Invalid value in username or password field
1704 = Invalid value in “type” field
1705 = Invalid Message
1706 = Invalid Destination
1707 = Invalid Source (Sender)
1708 = Invalid value for “DLR” field
1709 = User validation failed
1710 = Internal Error
1025 = Insufficient Credit : Saldo SMS habis
Message Type in Parameter (type sms)
Type = 0 —–> Text message (masuk ke inbox hp)
Type = 1 —–> Flash (tdk masuk ke inbox hp, relative tergantung merk hp)
Type = 2 —–> Unicode
Cek Saldo SMS
http://xxx.xxx.xxx.xxx:xxxx/DCreditCheck/checkcredits?username=username_anda&password=password_anda
(Untuk cek saldo maksimal 1 jam hanya bisa 3x cek via API)