Integrate SMS Into Your VB.NET Based Web Applications Or Systems
The code sample below shows you how to send SMS messages quickly using a simple VB.NET script based on the HTTP API. The script sends a single 1-way SMS message that will appear to come from "XYZCorp".
Send a 1-Way SMS Using VB.NET
' Import the required libraries Imports System.Net Imports System.IO ' Create a new web client to send the request Dim client As WebClient = New WebClient() ' Add the various parameters that need to go out ' with the HTTP request client.QueryString.Add("username", "my_username") client.QueryString.Add("password", "SecrEt12345") client.QueryString.Add("message", "Hello World") client.QueryString.Add("type", "1-way") client.QueryString.Add("senderid", "XYZCorp") client.QueryString.Add("to", "61400000000") ' Set the URL to send the request to, please note ' you can use either HTTP or HTTPS Dim url As String = "http://api.directsms.com.au/s3/http /send_message" ' Send the request and read the response Dim stream As Stream = client.OpenRead(url) Dim reader As StreamReader = New StreamReader(stream) Dim response As String = reader.ReadToEnd() ' Close the data stream and HTTP connection stream.Close() reader.Close() ' The response from the gateway is going to look like ' this: ' id: a4c5ad77ad6faf5aa55f66a ' ' In the event of an error, it will look like this: ' err: invalid login credentials
The full HTTP/S API documentation details all available features of directSMS' Bulk SMS Gateway. For additional help or if you have any questions, please contact our helpful support team.
How To Get Started
- Register online through our website and you can be sending SMS messages within minutes. The system will give you some free credits to use during your free trial.
- Notify the support team that you would like to enable API access on your new account.
- Create your client application using your chosen interface.
- Integrate your solution and start sending some test messages.
- Purchase more credits when you run out by clicking the Purchase Credits button once you log in.
- Talk to us about our bulk rates. Post-paid monthly accounts are available to corporate or government customers.
Get Started Now
FREE Business SMS Trial