VBA Sample Code (GET)
Public Sub Send()
Dim apikey As String
apikey = "apikey=" + "yourapiKey"
message As String
message = "&message=" + "This is your message"
Dim sender As String
sender = "&sender=" + "SmartSMS"
Dim phone As String
phone = "&phone=" + "923331234567,923211234567,923451234567"
Set MyRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
MyRequest.Open "GET", "https://www.hajanaone.com/api/sendsms.php?" +apikey + message + sender + phone
MyRequest.Send
MsgBox MyRequest.ResponseText
End Sub
VBA Sample Code (POST)
Public Sub Send()
Dim username As String
Dim password As String
Dim result As String
Dim myURL As String
Dim Sender As String
Dim numbers As String
Dim Message As String
Dim postData As String
Dim winHttpReq As Object
apikey = "yourAPIkey"
Sender = "SmartSMS"
phone = "923331234567,923001234567,923451234567"
Message = "This is your message"
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "https://www.hajanaone.com/api/sendsms.php?"
postData = "apikey=" + apikey + "&message=" + Message + "&phone=" + phone + "&sender=" + Sender
winHttpReq.Open "POST", myURL, False
winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
winHttpReq.Send (postData)
SendSMS = winHttpReq.responseText
End Sub