· 6 years ago · Sep 17, 2019, 08:24 AM
1Sub testSMS()
2
3sUsername = "Username"
4sKey = "APi KEY"
5sNohp = "Nohp"
6sPesan = "Ini pesan"
7sauth = "username=" & sUsername & "&" & "key=" & skey
8sauth2 = "number=" & sNohp & "&" & "message=" & sPesan
9
10Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
11URL = "Server" & sauth & sauth2
12objHTTP.Open "POST", URL, False
13objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
14objHTTP.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
15objHTTP.Send
16Debug.Print objHTTP.responseText
17End Sub
18
19API Respond
20Sukses kirim:
210|190990 ( id sms )
22
23Gagal Kirim :
24-1|username/key salah
25-2|Saldo Minus
26-3|Masa Aktif Sudah lewat
27-4|Penulisan nomor handphone salah
28-5|Maksimum sms per nomor per menit
29-6|Format api salah
30-7|System Error