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 Masking Alpha Sender ID Nama Perusahaan.
SMS ini yang muncul di penerima berupa huruf maksimal 11 karakter dapat dengan Nama Perusahaan atau Nama Merek. 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
Sample Script
<?php function Send_SMS( $to, $text ) { #example $to=”628xxxx,628xxxx”; $to = str_replace(' ', '',$to); $from = ""; //Sender ID or SMS Masking Name, if leave blank, it will use default from telco $username = "xxxx"; //your username $password = "xxxx"; //your password $getUrl = "https://[server]:[port]/sendsms?"; $ch = curl_init(); $apiUrl = $getUrl.'account='.$username.'&password='.$password.'&numbers='.$to.'&content='.rawurlencode($text); curl_setopt( $ch, CURLOPT_URL, $apiUrl); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); 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 ); if ($response) { print_r($response); } curl_close($ch); } $to = "6282xxxx";//masukkan nomor tujuan $message = "test sms 6282xxxake php calling";//masukkan isi pesan 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 SmsRestApiClient {
public static void main(String[] args) {
String tujuan = “628xxxx 628xxxx”;
String pesan = “Test sms java client”;
SmsRestApiClient smsClientRestApi = new SmsRestApiClient();
smsClientRestApi.sendSms(tujuan, pesan);
}
private void sendSms(String to, String content) {
String account = “xxxxx”;
String password = “xxxxx”;
try {
URL url = new URL(“http://<ip-address>:<port>/sendsms?”
+ “account=” + account
+ “&password=” + password
+ “&numbers=” + to.replaceAll(” “,””)
+ “&content=” + 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);
}
}
}
Dokumen HTTP API
Detail PARAMETER HTTP API
1. Get Balance (Cek Saldo SMS)
http://<ip-address>:<port>/getbalance?account=***&password=***
Respon:
{"status":0, "balance":"499740.000000", "gift":"0.000000"}
2. Send SMS (Kirim SMS)
http://<ip-address>:<port>/sendsms?account=***&password=***&numbers=***&content=***
Respon:
{"status":0, "array":[[6281210100055,1620443]], "success":1, "fail":0}
Input parameter:
Output parameter:
3. Get Report SMS (Laporan Pengiriman SMS)
http://<ip-address>:<port>/getreport?account=***&password=***&ids=1,2
Respon:
{"status":0, "array":[[1620442,6281210100055,20180619101517,0]], "success":1, "fail":0, "unsent":0, "sending":0, "nofound":0}
Input parameter:
Output parameter:
4. Get Inbox SMS (SMS Masuk)
http://<ip-address>:<port>/getsms?account=***&password=***
Respon:
{"status":0, "cnt":2, "array":[[1,10010,20171001123015, "********************************"], [2,1008611,20171001123015, "********************************"]]}
5. Actively Push and Send reports to the customer’s URL
The url of the push report of the consumer can be configured on the system. After the system sends the SMS, the result of the SMS will be pushed to the url specified by the customer in the way of put. The content of the report will be placed in the body of the request in the format of json.Push up to 50 send reports at a time.
Json message format
Push sample:
{"type":"report","cnt":2,"array":[[1,"1234545456",20180801123015,0,"success"],[2,"2356844545",20180801223015, 1, "no balance"]]}