Untitled Page

Send SMS Gateway API – VB6

This command can be used to send text messages to either individual numbers or entire contact groups.

Sample Request

                    
  1. Private Sub Command1_Click()
  2. Dim authKey, URL, mobiles, senderId, smsContentType, message, groupId, signature, routeId As String
  3. Dim V_signature, V_groupId, scheduleddate, V_scheduleddate As String
  4. Dim objXML As Object
  5. Dim getDataString As String
  6. authKey = "Sample Auth key" 'eg -- 16 digits alphanumeric
  7. URL = "Sample" 'eg-- www.abc.com
  8. mobiles = "Sample" '99999999xx,99999998xx
  9. smsContentType = "english" 'eg - english or unicode
  10. message = "Hello this is test"
  11. senderId = "Sample" 'eg -- Testin'
  12. routeId = “Sample" 'eg 1'
  13. scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
  14. signature ="" ‘optional if(signature available eg “1”)
  15. groupId ="" ‘optional if(groupId available eg “1”)
  16. If (Len(signature) > 0) Then
  17. V_signature = "&signature=" & signature
  18. End If
  19. If (Len(groupId) > 0) Then
  20. V_groupId = "&groupId=" & groupId
  21. End If
  22. If (Len(scheduleddate) > 0) Then
  23. V_scheduleddate = "&scheduleddate=" & scheduleddate
  24. End If
  25. URL = "Sample"
  26. 'use for API Reference
  27. Set objXML = CreateObject("Microsoft.XMLHTTP")
  28. 'creating data for url
  29. getDataString = URL + "AUTH_KEY=" + authKey + "&smsContent=" + message + "&mobileNos=" + mobiles + "&senderId=" + senderId + "&routeId=" + routeId +
  30. "&smsContentType=" + smsContentType + V_scheduleddate + V_groupId + V_signature
  31. objXML.Open "GET", getDataString, False
  32. objXML.Send
  33. If Len(objXML.ResponseText) > 0 Then
  34. MsgBox objXML.ResponseText
  35. End If
  36. End Sub
  37. Function URLEncode(ByVal Text As String) As String
  38. Dim i As Integer
  39. Dim acode As Integer
  40. Dim char As String
  41. URLEncode = Text
  42. For i = Len(URLEncode) To 1 Step -1
  43. acode = Asc(Mid$(URLEncode, i, 1))
  44. Select Case acode
  45. Case 48 To 57, 65 To 90, 97 To 122
  46. ' don't touch alphanumeric chars
  47. Case 32
  48. ' replace space with "+"
  49. Mid$(URLEncode, i, 1) = "+"
  50. Case Else
  51. ' replace punctuation chars with "%hex"
  52. URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
  53. (URLEncode, i + 1)
  54. End Select
  55. Next
  56. End Function
                    
  1. Private Sub Command1_Click()
  2. Dim As Object
  3. Dim message As String
  4. Dim authKey As String
  5. Dim mobileNos As String
  6. Dim senderId As String
  7. Dim routeId As String
  8. Dim groupId As String
  9. Dim sURL, URL As String
  10. Dim smsContentType As String
  11. Dim signature As String
  12. Dim returnData As String
  13. 'Set these variables
  14. authKey = "Sample Auth key"'eg -- 16 digits alphanumeric
  15. URL = "Sample"'eg-- www.abc.com
  16. mobileNos = "Sample"'99999999xx,99999998xx
  17. smsContentType = "english"'eg - english or unicode
  18. message = "Hello this is test"
  19. senderId = "Sample" 'eg -- Testin'
  20. routeId = “Sample" 'eg 1'
  21. scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
  22. signature ="" ‘optional if(signature available eg “1”)
  23. groupId ="" ‘optional if(groupId available eg “1”)
  24. 'adding URL + AuthKey
  25. sURL = URL & "?AUTH_KEY=" & authKey
  26. Set objXML = CreateObject("Microsoft.XMLHTTP")
  27. objXML.Open "POST", sURL, False
  28. objXML.SetRequestHeader "Content-Type", "application/json"
  29. returnData = SendSMSPostData(message, senderId, routeId, mobileNos, smsContentType, signature, groupId, scheduleddate)
  30. ' Text1.Text = returnData
  31. objXML.Send returnData
  32. MsgBox returnData
  33. ' objXML.Send (returnData)
  34. '"AUTH_KEY=" + authKey + "smsContent=" + message + "&mobileNumbers=" + mobiles + "&senderId=" + sender + "&routeId=" + route + "&smsContentType=" + smsContent
  35. If Len(objXML.ResponseText) > 0 Then
  36. MsgBox objXML.ResponseText
  37. End If
  38. End Sub
  39. Function SendSMSPostData(smsContent As String, senderId As String, routeId As String,
  40. mobileNos As String, smsContentType As String, signature As String, groupId As String, scheduleddate As String) As String
  41. Dim data, V_groupId, V_mobileNos, V_senderId, V_smsContentType, V_signature, V_routeId, V_authKey, V_smsContent, V_scheduleddate As String
  42. 'V_authKey = "AUTH_KEY=" & authKey
  43. 'sURL = "Sample"
  44. V_smsContent = "{""smsContent""" & ":""" & smsContent & ""","
  45. V_routeId = """routeId""" & ":""" & routeId & ""","
  46. V_groupId = """groupId""" & ":""" & groupId & ""","
  47. V_mobileNos = """mobileNumbers""" & ":""" & mobileNos & ""","
  48. V_senderId = """senderId""" & ":""" & senderId & ""","
  49. V_smsContentType = """smsContentType""" & ":""" & smsContentType & """"
  50. data = V_smsContent & V_senderId & V_routeId & V_mobileNos & V_smsContentType & V_signature
  51. If (Len(signature) > 0) Then
  52. V_signature = ",""signature""" & ":""" & signature & """"
  53. data = data + V_signature
  54. ' MsgBox V_signature
  55. End If
  56. If (Len(groupId) > 0) Then
  57. V_groupId = ",""groupId""" & ":" & """ groupId & """""
  58. data = data + V_groupId
  59. 'MsgBox V_signature
  60. End If
  61. If (Len(scheduleddate) > 0) Then
  62. V_scheduleddate = ",""scheduleddate""" & ":" & """ scheduleddate & """""
  63. ' data = data + V_scheduleddatev
  64. End If
  65. data = data + "}"
  66. SendSMSPostData = data
  67. End Function
  68. Function URLEncode(ByVal Text >As String) As String
  69. Dim i As Integer
  70. Dim acode As Integer
  71. Dim char As String
  72. URLEncode = Text
  73. For i = Len(URLEncode) To 1 Step -1
  74. acode = Asc(Mid$(URLEncode, i, 1))
  75. Select Case acode
  76. Case 48 To 57, 65 To 90, 97 To 122
  77. ' don't touch alphanumeric chars
  78. Case 32
  79. ' replace space with "+"
  80. Mid$(URLEncode, i, 1) = "+"
  81. Case Else
  82. ' replace punctuation chars with "%hex"
  83. URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
  84. (URLEncode, i + 1)
  85. End Select
  86. Next
  87. Function
                    
  1. Private Sub Command1_Click()
  2. Dim objXML As Object
  3. Dim message As String
  4. Dim authKey As String
  5. Dim mobileNos As String
  6. Dim senderId As String
  7. Dim routeId As String
  8. Dim groupId As String
  9. Dim sURL, URL As String
  10. Dim smsContentType As String
  11. Dim signature As String
  12. Dim returnData As String
  13. 'Set these variables
  14. authKey = "Sample Auth key" 'eg -- 16 digits alphanumeric
  15. URL = "Sample" 'eg-- www.abc.com
  16. mobileNos = "Sample" '99999999xx,99999998xx
  17. smsContentType = "english" 'eg - english or unicode
  18. message = "Hello this is test"
  19. senderId = "Sample" 'eg -- Testin'
  20. routeId = “Sample" 'eg 1'
  21. scheduleddate = "" ‘optional if(scheduledate eg “26/08/2015 17:00”)
  22. signature ="" ‘optional if(signature available eg “1”)
  23. groupId ="" ‘optional if(groupId available eg “1”)
  24. 'adding URL + AuthKey
  25. sURL = URL & "?AUTH_KEY=" & authKey
  26. Set objXML = CreateObject("Microsoft.XMLHTTP")
  27. objXML.Open "POST", sURL, False
  28. objXML.SetRequestHeader "Content-Type", "application/xml"
  29. returnData = SendSMSXMLData(authKey, message, senderId, routeId, mobileNos, smsContentType, signature, groupId, "")
  30. ' Text1.Text = returnData
  31. objXML.Send (returnData)
  32. '"AUTH_KEY=" + authKey + "smsContent=" + message + "&mobileNumbers=" + mobiles + "&senderId=" + sender + "&routeId=" + route + "&smsContentType=" + smsContent
  33. If Len(objXML.ResponseText) > 0 Then
  34. MsgBox objXML.ResponseText
  35. End If
  36. End Sub
  37. Function URLEncode(ByVal Text As String) As String
  38. Dim i As Integer
  39. Dim acode As Integer
  40. Dim char As String
  41. URLEncode = Text
  42. For i = Len(URLEncode) To 1 Step -1
  43. acode = Asc(Mid$(URLEncode, i, 1))
  44. Select Case acode
  45. Case 48 To 57, 65 To 90, 97 To 122
  46. ' don't touch alphanumeric chars
  47. Case 32
  48. ' replace space with "+"
  49. Mid$(URLEncode, i, 1) = "+"
  50. Case Else
  51. ' replace punctuation chars with "%hex"
  52. URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _
  53. (URLEncode, i + 1)
  54. End Select
  55. Next
  56. End Function
  57. Function SendSMSXMLData(authKey As String, smsContent As String, senderId As String, routeId As String, mobileNos As String,
  58. smsContentType As String, signature As String, groupId As String, scheduleddate As String) As String
  59. Dim data, V_groupId, V_mobileNos, V_senderId, V_smsContentType, V_signature, V_routeId, V_authKey, V_smsContent, V_scheduleddate As String
  60. 'V_authKey = "AUTH_KEY=" & authKey
  61. 'sURL = "http://167.114.186.70/rest/services/sendSMS/sendGroupSms"
  62. V_smsContent = "<smsContent>" & smsContent & "</smsContent>"
  63. V_routeId = "<routeId>" & routeId & "</routeId>"
  64. V_mobileNos = "<mobileNumbers>" & mobileNos & "</mobileNumbers>" '"""mobileNumbers""" & ":""" & mobileNos & ""","
  65. V_senderId = "<senderId>" & senderId & "</senderId>" '"""senderId""" & ":""" & senderId & ""","
  66. V_smsContentType = "<smsContentType>" & smsContentType & "</smsContentType>" '"""smsContentType""" & ":""" & smsContentType & """"
  67. If (Len(signature) > 0) Then
  68. V_signature = "<signature>" & signature & "</signature>" ' ",""signature""" & ":""" & signature & """"
  69. End If
  70. If (Len(groupId) > 0) Then
  71. V_groupId = ",""groupId""" & ":" & """ groupId & """""
  72. End If
  73. If (Len(scheduleddate) > 0) Then
  74. V_scheduleddate = ",""scheduleddate""" & ":" & """ scheduleddate & """""
  75. End If
  76. 'data = data + "</SMS>"
  77. data = "<Sms>" + "<AUTH_KEY>" + authKey + "</AUTH_KEY>" + V_smsContent & V_senderId & V_routeId & V_mobileNos & V_smsContentType & V_signature + "</Sms>"
  78. SendSMSXMLData = data
  79. 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 are the best bulk SMS services provider, aim to make messaging easy and therefore,we provide our Bulk SMS API functionality so that the user can Send SMS from anywhere. 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 India, 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 India 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 India to integrate it in your software and increase its functionality.

How to integrate bulk sms gateway api in VB 6 ?

    • Sign up with Msgclub 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 permits you to integrate SMS services into your own System/application/Website for advancement and better functionality.

      To generate request for the Bulk SMS API just calling a URL with some required parameters like 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. Msgclub 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#.

Parameter Name with Description

Parameter Name Data Type Description
AUTH_KEY * Alphanumeric Login Authentication Key(This key is unique for every user)
message * Text Enter your message
senderId * Text Enter senderId it should be less then 6 character
routeId * Integer Which route you want use for sending sms enter routeId for particular route.use given Id for route. Transactional Route=1, Promotinal=2, Promotional SenderId=3
mobileNos * Integer Mobile number can be entered with country code or without country code Multiple mobile no. should be separated by comma
groupId * Integer To send sms to particular group enter group name created in MsgClub phone book.
smsContentType* Text "English" for text sms and "Unicode" for Unicode sms

Parameters with( * ) are mandatory.

Note: While both numbers and group_id are optional parameters, one or the other must be included in the request for the message to be sent.

Errors

Error Codes Description
3001 * for Success
3002 * Invalid URL
3003 * Invalid User/Password
3004 * Invalid Message Type
3005 * Invalid Message
3006 * Invalid Destination
3007 * Invalid Source
3008 * Invalid DLR Field
3009 * Authentication Failed
3010 * Internal Error
3011 * Insufficient Balance
3012 * Responce Time Out
3013 * Invalid Request Content Type
3014 * Missing Mobile Number
3015 * SMs Content for Approval
3016 * Missing Required Parameter
3017 * FAIL
3018 * Expired Account
3019 * Null Pointer Exception code
3020 * Empty User Name
3021 * Empty Password
3022 * User Name not Available
3023 * Session Expired
3024 * Already Exist
3025 * Empty Group Name
3026 * Empty Contact Name
3027 * Empty Mobile Number
3028 * Empty Group Id
3029 * Empty City Name
3030 * Empty Occupation
3041 * Empty E-Mail Id
3042 * Group not Exist
3043 * Empty Message
3044 * Empty Route Id
3045 * Empty Sender Id
3047 * Empty Draft Id
3048 * Empty First Name
3049 * Empty Last Name
3050 * Empty Balance
3051 * Empty Role Id
3052 * For User Name Length
3053 * Empty Expiry Date/td>
3054 * Invalid Date
3055 * Empty Client Id
3056 * Invalid Status
3057 * Empty Country Name
3058 * Empty State Name
3059 * Session Expired
3060 * Empty Date
3061 * Access Denied
3062 * Empty Old Password
3063 * Password not Maching
3064 * Empty SMS
3065 * Empty Amount
3066 * Empty Address
3067 * Empty RequestId
3068 * Empty Group and MobileNo
3069 * Empty Description
3070 * Fail to Change RoleId
3071 * Empty CallerId
3072 * Empty File URL and Draft
3073 * Empty Duration
3074 * Invalid Request
3075 * Invalid Aoudio file
3076 * Missing Upload File

Warnings

Warning Codes
3 Invalid number.
For Any Help Call Us Anywhere Anytime On   +91-94068-11127