Sign up!
Create a user account and send your SMS messages in seconds. You will have all the functionalities and benefits in the same platform.
Send from API and manage your account with our online application WebSMS.
Below you will find the examples of programming code in the language VB.net to send SMS messages through the API of the LabsMobile platform.
You also have code examples in Visual Basic and other programming languages.
We recommend you to consult and take into account the following resources and help in your integration:
This is the sample code in VB.net to send SMS messages with the LabsMobile SMS API in the JSON version. As you can see, you must create a JSON structure with all the sending parameters and make an HTTP/POST call with the JSON data in the body of the call.
It is essential to make the call with the authentication of the username (registration email) and the password (or token API) of the account.
Dim myReq As HttpWebRequest Dim myResp As HttpWebResponse myReq = HttpWebRequest.Create("https://api.labsmobile.com/json/send") myReq.Method = "POST" myReq.ContentType = "application/json" myReq.Headers.add("Authorization", "Basic " & Convert.ToBase64String(Encoding.UTF8.GetBytes("myusername:mypassword"))) Dim myData As String = "{\"message\":\"Text of the SMS message\", \"tpoa\":\"Sender\",\"recipient\":[{\"msisdn\":\"12015550123\"},{\"msisdn\":\"447400123456\"},{\"msisdn\":\"5212221234567\"}]}" myReq.GetRequestStream.Write(System.Text.Encoding.UTF8.GetBytes(myData), 0, System.Text.Encoding.UTF8.GetBytes(myData).Count) myResp = myReq.GetResponse Dim myreader As New System.IO.StreamReader(myResp.GetResponseStream) Dim myText As String myText = myreader.ReadToEnd
You can check all available JSON parameters, configuration options, manuals and specifications in the following url: https://apidocs.labsmobile.com/?vb--vbnet#send-sms
Example of code in VB.net for consulting the balance of an account. The result is always obtained in internal credits of the LabsMobile platform.
Dim myReq As HttpWebRequest Dim myResp As HttpWebResponse myReq = HttpWebRequest.Create("https://api.labsmobile.com/json/balance") myReq.Method = "GET" myReq.ContentType = "application/json" myReq.Headers.add("Authorization", "Basic " & Convert.ToBase64String(Encoding.UTF8.GetBytes("myusername:mypassword"))) myResp = myReq.GetResponse Dim myreader As New System.IO.StreamReader(myResp.GetResponseStream) Dim myText As String myText = myreader.ReadToEnd
Example of sending for the GET version of the LabsMobile SMS API. This is a basic and simple method of sending SMS messages from an application or software created in VB.net passing all the parameters in the same url.
It is important to encode all the values as url (with the function urlencode() for example).
You can see and download the GET API manual of LabsMobile in the following URL: https://www.labsmobile.com/en/api-sms/api-versions/http-get
Imports System.Net Imports System.IO Dim client As WebClient = New WebClient client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") client.QueryString.Add("username", "xx@xx.xxx") client.QueryString.Add("password", "xxxxxxxx") client.QueryString.Add("msisdn", "xxxx") client.QueryString.Add("message", "This is an example message") Dim baseurl As String = "http://api.labsmobile.com/get/send.php" Dim data As Stream = client.OpenRead(baseurl) Dim reader As StreamReader = New StreamReader(data) Dim s As String = reader.ReadToEnd() data.Close() reader.Close() Return
Imports System.Net Imports System.IO Dim client As WebClient = New WebClient client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)") client.QueryString.Add("username", "xx@xx.xxx") client.QueryString.Add("password", "xxxxxxxx") Dim baseurl As String = "http://api.labsmobile.com/get/balance.php" Dim data As Stream = client.OpenRead(baseurl) Dim reader As StreamReader = New StreamReader(data) Dim s As String = reader.ReadToEnd() data.Close() reader.Close() Return
Within the VisualStudio.net program, in section Solution Explorer click on Add Service Reference. Copy the following URL: http://api.labsmobile.com/ws/services/LabsMobileWsdl.php?wsdl. Create a name for the Namespace for example"LabsMobileAPI".
Dim res As String = New client.LabsMobileAPI.SendSMS( "priv00x", "xx@xx.xxx", "xxxxxxxx", "<?xml version="1.0" encoding="UTF-8"?> <sms> <recipient> <msisdn>34609827393</msisdn> </recipient> <message><![CDATA[This is an example message]]></message> </sms>")
Within the VisualStudio.net program, in section Solution Explorer click on Add Service Reference. Copy the following URL: http://api.labsmobile.com/ws/services/LabsMobileWsdl.php?wsdl. Create a name for the Namespace for example"LabsMobileAPI".
string resultado = new Client.LabsMobileAPI.GetCredit( "xx@xx.xxx", "xxxxxxxx")
Create a user account and send your SMS messages in seconds. You will have all the functionalities and benefits in the same platform.
Send from API and manage your account with our online application WebSMS.
Bulk SMSLanding messaging campaigns for large brands, and to hold and manage sporting events.
At LabsMobile we only offer direct routes of maximum reliability and quality. Enjoy our platform and all our services for the price of an SMS.
Pay ONLY for sent messages.
Our technical department has professionals with years of experience and we have made multiple integrations.
We guide and help you through the process.
This tutorial explains how to send bulk messages or other messages straight from an Excel file.