ZapitSMS for SMS API
The ZapitSMS API makes it easy to send SMS messages from your existing applications. The following code snippets show how much code is required in the various languages in which the ZapitSMS API provides sample source code.
Download the ZapitSMS API from here.
Examples using the API
Email
Sending SMS from email is simple, just address the email to the destination mobile phone number <phone_number>@zapitsms.net.
Any system or application that can send an email can send an SMS.
To use the email API it must first be enabled in your user account.
For more information, click here.PHP
<? include "zapitsms.php"; $myusername = "myusername"; $mypassword = "mypassword"; $error = ""; $from = ""; // Automatically assigned $result = SendSMS($myusername, $mypassword, "61499999999", $from, "SMS From PHP", $error); if($result == 0) { // Success echo "SMS Sent successfully."; } else { // Error echo "SMS Send failed. $error"; } ?>VB.NET
Dim un As String Dim pass As String Dim to As String Dim from As String Dim message As String Dim xml_response As String un = "myuser1" pass = "mypass" to = "61405910000" from = "" message = "Hello from VB.NET" xml_response = SendSMS(un, pass, to, from, message)
JAVA
import com.zapitsms.sms.*; class ZapitTest { public static void main(String[] args) { HTTPSms sms = new HTTPSms(); String[] data = sms.getUserInfo("username", "password"); for(int i = 0; i < data.length; i++) { System.out.println(data[i]); } if(sms.sendSMS("username", "password", "61499999999", "SMS from Java")) { System.out.println("Success"); } else { System.out.println(sms.getError()); } } }C#
string un; string pass; string to; string from; string message; string xml_response; un = "myuser1"; pass = "mypass"; to = "61405910000"; from = ""; // Automatic message = "Test Message";; xml_response = SendSMS(un,pass,to,from,message);
ASP
Dim un, pw, to, from, message, xml_response un = "myuser1" pw = "mypass" to = "61405910000" from = "61405911111" message = "Test Message" xml_response = SendSMS(un,pw,to,from,message)