Send SMS Gateway API – VB6
This command can be used to send text messages to either individual numbers or entire contact groups.
Sample Request
- Private Sub Command1_Click()
- Dim authKey, URL, mobiles, senderId, smsContentType, message, groupId, signature, routeId As String
- Dim V_signature, V_groupId, scheduleddate, V_scheduleddate As String
- Dim objXML As Object
- Dim getDataString As String
-
- authKey = "Sample Auth key" 'eg -- 16 digits alphanumeric
- URL = "Sample" 'eg-- www.abc.com
- mobiles = "Sample" '99999999xx,99999998xx
- smsContentType = "english" 'eg - english or unicode
- message = "Hello this is test"
- senderId = "Sample" 'eg -- Testin'
- routeId = “Sample" 'eg 1'
- scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
- signature ="" ‘optional if(signature available eg “1”)
- groupId ="" ‘optional if(groupId available eg “1”)
- If (Len(signature) > 0) Then
- V_signature = "&signature=" & signature
- End If
- If (Len(groupId) > 0) Then
- V_groupId = "&groupId=" & groupId
- End If
- If (Len(scheduleddate) > 0) Then
- V_scheduleddate = "&scheduleddate=" & scheduleddate
- End If
- URL = "Sample"
- 'use for API Reference
- Set objXML = CreateObject("Microsoft.XMLHTTP")
- 'creating data for url
- getDataString = URL + "AUTH_KEY=" + authKey + "&smsContent=" + message + "&mobileNos=" + mobiles + "&senderId=" + senderId + "&routeId=" + routeId + "&smsContentType=" + smsContentType + V_scheduleddate + V_groupId + V_signature
- objXML.Open "GET", getDataString, False
- objXML.Send
- If Len(objXML.ResponseText) > 0 Then
- MsgBox objXML.ResponseText
- End If
- End Sub
- Function URLEncode(ByVal Text As String) As String
- Dim i As Integer
- Dim acode As Integer
- Dim char As String
- URLEncode = Text
- For i = Len(URLEncode) To 1 Step -1
- acode = Asc(Mid$(URLEncode, i, 1))
- Select Case acode
- Case 48 To 57, 65 To 90, 97 To 122
- ' don't touch alphanumeric chars
- Case 32
- ' replace space with "+"
- Mid$(URLEncode, i, 1) = "+"
- Case Else
- ' replace punctuation chars with "%hex"
- URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
- (URLEncode, i + 1)
- End Select
- Next
- End Function
- Private Sub Command1_Click()
- Dim As Object
- Dim message As String
- Dim authKey As String
- Dim mobileNos As String
- Dim senderId As String
- Dim routeId As String
- Dim groupId As String
- Dim sURL, URL As String
- Dim smsContentType As String
- Dim signature As String
- Dim returnData As String
- 'Set these variables
- authKey = "Sample Auth key"'eg -- 16 digits alphanumeric
- URL = "Sample"'eg-- www.abc.com
- mobileNos = "Sample"'99999999xx,99999998xx
- smsContentType = "english"'eg - english or unicode
- message = "Hello this is test"
- senderId = "Sample" 'eg -- Testin'
- routeId = “Sample" 'eg 1'
- scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
- signature ="" ‘optional if(signature available eg “1”)
- groupId ="" ‘optional if(groupId available eg “1”)
-
- 'adding URL + AuthKey
- sURL = URL & "?AUTH_KEY=" & authKey
- Set objXML = CreateObject("Microsoft.XMLHTTP")
- objXML.Open "POST", sURL, False
- objXML.SetRequestHeader "Content-Type", "application/json"
-
- returnData = SendSMSPostData(message, senderId, routeId, mobileNos, smsContentType, signature, groupId, scheduleddate)
-
- ' Text1.Text = returnData
-
- objXML.Send returnData
- MsgBox returnData
-
- ' objXML.Send (returnData)
-
- '"AUTH_KEY=" + authKey + "smsContent=" + message + "&mobileNumbers=" + mobiles + "&senderId=" + sender + "&routeId=" + route + "&smsContentType=" + smsContent
- If Len(objXML.ResponseText) > 0 Then
- MsgBox objXML.ResponseText
-
- End If
- End Sub
- Function SendSMSPostData(smsContent As String, senderId As String, routeId As String,
- mobileNos As String, smsContentType As String, signature As String, groupId As String, scheduleddate As String) As String
- Dim data, V_groupId, V_mobileNos, V_senderId, V_smsContentType, V_signature, V_routeId, V_authKey, V_smsContent, V_scheduleddate As String
- 'V_authKey = "AUTH_KEY=" & authKey
- 'sURL = "Sample"
- V_smsContent = "{""smsContent""" & ":""" & smsContent & ""","
- V_routeId = """routeId""" & ":""" & routeId & ""","
- V_groupId = """groupId""" & ":""" & groupId & ""","
- V_mobileNos = """mobileNumbers""" & ":""" & mobileNos & ""","
- V_senderId = """senderId""" & ":""" & senderId & ""","
- V_smsContentType = """smsContentType""" & ":""" & smsContentType & """"
- data = V_smsContent & V_senderId & V_routeId & V_mobileNos & V_smsContentType & V_signature
- If (Len(signature) > 0) Then
- V_signature = ",""signature""" & ":""" & signature & """"
- data = data + V_signature
- ' MsgBox V_signature
- End If
- If (Len(groupId) > 0) Then
- V_groupId = ",""groupId""" & ":" & """ groupId & """""
- data = data + V_groupId
- 'MsgBox V_signature
- End If
- If (Len(scheduleddate) > 0) Then
- V_scheduleddate = ",""scheduleddate""" & ":" & """ scheduleddate & """""
- ' data = data + V_scheduleddatev
- End If
- data = data + "}"
- SendSMSPostData = data
- End Function
- Function URLEncode(ByVal Text >As String) As String
- Dim i As Integer
- Dim acode As Integer
- Dim char As String
- URLEncode = Text
- For i = Len(URLEncode) To 1 Step -1
- acode = Asc(Mid$(URLEncode, i, 1))
- Select Case acode
- Case 48 To 57, 65 To 90, 97 To 122
- ' don't touch alphanumeric chars
- Case 32
- ' replace space with "+"
- Mid$(URLEncode, i, 1) = "+"
- Case Else
- ' replace punctuation chars with "%hex"
- URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
- (URLEncode, i + 1)
- End Select
- Next
- Function
- Private Sub Command1_Click()
- Dim objXML As Object
- Dim message As String
- Dim authKey As String
- Dim mobileNos As String
- Dim senderId As String
- Dim routeId As String
- Dim groupId As String
- Dim sURL, URL As String
- Dim smsContentType As String
- Dim signature As String
- Dim returnData As String
- 'Set these variables
- authKey = "Sample Auth key" 'eg -- 16 digits alphanumeric
- URL = "Sample" 'eg-- www.abc.com
- mobileNos = "Sample" '99999999xx,99999998xx
- smsContentType = "english" 'eg - english or unicode
- message = "Hello this is test"
- senderId = "Sample" 'eg -- Testin'
- routeId = “Sample" 'eg 1'
- scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
- signature ="" ‘optional if(signature available eg “1”)
- groupId ="" ‘optional if(groupId available eg “1”)
-
- 'adding URL + AuthKey
- sURL = URL & "?AUTH_KEY=" & authKey
- Set objXML = CreateObject("Microsoft.XMLHTTP")
- objXML.Open "POST", sURL, False
- objXML.SetRequestHeader "Content-Type", "application/xml"
-
- returnData = SendSMSXMLData(authKey, message, senderId, routeId, mobileNos, smsContentType, signature, groupId, "")
-
- ' Text1.Text = returnData
- objXML.Send (returnData)
-
- '"AUTH_KEY=" + authKey + "smsContent=" + message + "&mobileNumbers=" + mobiles + "&senderId=" + sender + "&routeId=" + route + "&smsContentType=" + smsContent
- If Len(objXML.ResponseText) > 0 Then
- MsgBox objXML.ResponseText
-
- End If
- End Sub
- Function URLEncode(ByVal Text As String) As String
- Dim i As Integer
- Dim acode As Integer
- Dim char As String
-
- URLEncode = Text
-
- For i = Len(URLEncode) To 1 Step -1
- acode = Asc(Mid$(URLEncode, i, 1))
- Select Case acode
- Case 48 To 57, 65 To 90, 97 To 122
- ' don't touch alphanumeric chars
- Case 32
- ' replace space with "+"
- Mid$(URLEncode, i, 1) = "+"
- Case Else
- ' replace punctuation chars with "%hex"
- URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
- (URLEncode, i + 1)
- End Select
- Next
-
- End Function
- Function SendSMSXMLData(authKey As String, smsContent As String, senderId As String, routeId As String, mobileNos As String,
- smsContentType As String, signature As String, groupId As String, scheduleddate As String) As String
- Dim data, V_groupId, V_mobileNos, V_senderId, V_smsContentType, V_signature, V_routeId, V_authKey, V_smsContent, V_scheduleddate As String
- 'V_authKey = "AUTH_KEY=" & authKey
- 'sURL = "http://167.114.186.70/rest/services/sendSMS/sendGroupSms"
- V_smsContent = "<smsContent>" & smsContent & "</smsContent>"
- V_routeId = "<routeId>" & routeId & "</routeId>"
- V_mobileNos = "<mobileNumbers>" & mobileNos & "</mobileNumbers>" '"""mobileNumbers""" & ":""" & mobileNos & ""","
- V_senderId = "<senderId>" & senderId & "</senderId>" '"""senderId""" & ":""" & senderId & ""","
- V_smsContentType = "<smsContentType>" & smsContentType & "</smsContentType>" '"""smsContentType""" & ":""" & smsContentType & """"
- If (Len(signature) > 0) Then
- V_signature = "<signature>" & signature & "</signature>" ' ",""signature""" & ":""" & signature & """"
- End If
- If (Len(groupId) > 0) Then
- V_groupId = ",""groupId""" & ":" & """ groupId & """""
- End If
- If (Len(scheduleddate) > 0) Then
- V_scheduleddate = ",""scheduleddate""" & ":" & """ scheduleddate & """""
- End If
- 'data = data + "</SMS>"
- data = "<Sms>" + "<AUTH_KEY>" + authKey + "</AUTH_KEY>" + V_smsContent & V_senderId & V_routeId & V_mobileNos & V_smsContentType & V_signature + "</Sms>"
- SendSMSXMLData = data
- End Function
Caution: Some users opt to place their request inside a code loop, while testing we highly recommend setting the test parameter to true , as occasionally an infinite loop can occur and users can consume all their credits very quickly.
We aim to make messaging easy and therefore,we provide our Bulk SMS API functionality so that the user can Send SMS from anywhere and everywhere. We do provide our SMS APIs for each and every purpose i.e. text message API, Bulk SMS API, Scheduled SMS API, GetBalance, Add Balance, Delivery status, SMS API, Send SMS Gateway API etc.
We provide our users with a wide range of Bulk SMS APIs which in turn help our users to avoid unnecessary coding and struggling which saves their time.
Discover appropriate Bulk SMS API for your need and utilise messaging services to its best. We provide our users with APIs for each and every purpose. Integrate distinct API with sample codes as per choice of programming language. You can easily Send Bulk SMS in case of heavy traffic via our VB6 API. We are providing various SMS VB6 API to integrate it in your software and increase its functionality.
How to integrate bulk sms gateway api in VB 6 ?
- Sign up with SMS Cluster and go to developer tool for VB 6 Api and follow the simple steps to integrate bulk SMS API in your website. You will get POST and GET both type of send sms VB 6 API which are ready to use and source code for sms gateway. Our Send sms VB 6 script is used by many software companies and startups as sms verification api in India.Our sms api documentation is one of best for sms api for VB 6 developers
We are sms api providers for sms notification system, signup messages, alert message and verification code using VB 6 code. Our developer guide also help our clients sms gateway api integration in VB 6 websites or softwares
We also have ready wordpress sms api and drupal sms api.
How to send verification code to mobile using VB 6 ?
- To send the verification code to mobile through SMS using VB 6 is possible only with the API Integration.
How can I send bulk sms from my website by integrating sms gateway api in VB 6 .
- API is the best way to send SMS directly from your website. As it allows you to integrate SMS services into your own System/application/Website for better functionality.
A request to the Bulk SMS API is done by calling a URL with some required parameters (User Name, Password, Sender ID, Mobile Number, Message).When a request is made, the API along with all the parameters send to SMS Gateway server and it process the request and generate response for the particular request immediately. SMS Cluster provides the Bulk SMS Gateway with HTTP API (HTTP) to be integrated in different programming language like VB 6 ,php,Java, VB 6.net, C#.