Java SDK

Send messages from Java Apps

Using the IntelliSMS Java SMS SDK you can send SMS messages from your Java code. This Java SMS Library is free to download, use and distribute.

Java Sample:

import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

        IntelliSMS objIntelliSMS = new IntelliSMS();
        objIntelliSMS.Username = "MyUsername";
        objIntelliSMS.Password = "MyPassword";

        objIntelliSMS.SendMessage ( "44771012345,44771023456", "Hello", "SENDER_ID" );

Properties:

Username This is the username of your account
Password This is the password for your account
MaxConCatMsgs Maximum number of concatenated SMS messages that will be sent per recipient (Default is 1)

SendMessage Method

Sends an SMS message via the Internet Gateway.

SendStatusCollection SendMessage ( String[] ToList, String Message, String From )
throws IntelliSMSException

Parameters:

ToList Input String array containing destination phone numbers
Message Input The content of the text message
From Input This is the source/sender's phone number
SendStatusCollection Return Collection containing the send status for each recipient. See SendStatusCollection

Exceptions:

IntelliSMSException Error returned by the IntelliSoftware SMS gateway

Java Sample:

import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

IntelliSMS objIntelliSMS = new IntelliSMS();
objIntelliSMS.Username = "MyUsername";
objIntelliSMS.Password = "MyPassword";

objIntelliSMS.SendMessage ( "44771012345,44771023456", "Hello", "SENDER_ID" );

SendUnicodeMessage Method

Sends a UnicodeSMS message to multiple recipients via the Internet Gateway. The Unicode format is used to send multilingual messages not support by the standard GSM character set.

SendStatusCollection SendUnicodeMessage ( String[] ToList, String Message, String From )
throws IntelliSMSException

See Unicode Character Codes for more details.

Parameters:

ToList Input String array containing destination phone numbers
Message Input The content of the text message
From Input This is the source/sender's phone number
SendStatusCollection Return Array containing the send status for each recipient. See SendStatusCollection

Exceptions:

IntelliSMSException Error returned by the IntelliSoftware SMS gateway

Java Sample:

import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

IntelliSMS objIntelliSMS = new IntelliSMS();
objIntelliSMS.Username = "MyUsername";
objIntelliSMS.Password = "MyPassword";

objIntelliSMS.SendUnicodeMessage ( "44771012345,44771023456", "Hello", "SENDER_ID" );

SendBinary Message Method

Sends a Binary SMS message via the Internet Gateway. Binary Messages can be used to send SmartMessages, such as Ringtones and Logos.

SendStatusCollection SendBinaryMessage ( string[] ToList, string UeerDataHeaderHex, string UserDataHex, string From ) throws IntelliSMSException

Parameters:

ToList Input This is the destination phone number
UeerDataHeaderHex Input (Optional) User Data Header
UserDataHex Input User Data (140 octets max)
From Input This is the source/sender's phone number
SendStatusCollection Return Collection containing the send status for each recipient. See SendStatusCollection

Java Sample:

<?Java

include 'IntelliSMS.Java';

//Required Java.ini settings:
// allow_url_fopen = On
// track_errors = On

$objIntelliSMS = new IntelliSMS();

$objIntelliSMS->Username = 'MyUsername';
$objIntelliSMS->Password = 'MyPassword';

$objIntelliSMS->SendBinaryMessage ( "44771012345,44771023456", 
    "06050415820000", 
    "32F40100480E0100000000000000000000000000000000000000" .
    "0000000000000000000001247803000000E0080120CC06400000" .
    "40080120CC06C00000479E7124F0EFFADCF64448892479B6DAC6" .
    "CD4448F9241DB6DACECF44488124CDB6CD96CC44488924CDB6CD" .
    "96CDE446712478E66D9EC6000000000000000000000000000000" .
    "000000", "SENDER_ID" );
?>

SendWapPush Message Method

Sends a WAP PUSH message via the Internet Gateway. WAP PUSH messages can send multimedia content, such as an Image, Wallpaper, Ringtone or a link to WAP website.

SendStatusCollection SendWapPushMessage ( String[] ToList, String Title, String HRef, String From ) throws IntelliSMSException

Parameters:

ToList Input String array containing destination phone numbers
Title Input Display Text for WAP PUSH message
HRef Input URL link to resource ( should start with 'http://' or 'https://' )
From Input This is the source/sender's phone number
SendStatusCollection Return

Array containing the send status for each recipient. See SendStatusCollection

Exceptions:

IntelliSMSException Error returned by the IntelliSoftware SMS gateway

Java Sample:

import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

IntelliSMS objIntelliSMS = new IntelliSMS();
objIntelliSMS.Username = "MyUsername";
objIntelliSMS.Password = "MyPassword";

objIntelliSMS.SendWapPushMessage ( "44771012345",
    'The message text', 
    'http://www.intellisoftware.co.uk/images/IntelliSMS.gif', 
    'SENDER_ID' );

				

Considerations:

Our gateway will only send one SMS message per submission. Therefore a WAP PUSH message is charged at 1 credit.

An INVALID_REQUEST will result if the submitted text and href parameters would require 2 SMS messages to be sent. As a guide, the href and text parameters combined should not exceed 114 characters (assuming href starts with 'http://www.')

GetBalance Method

Obtains the available credits on an account.

int GetBalance () throws IntelliSMSException

Parameters:

Available Balance Return Number of remaining credits

Exceptions:

IntelliSMSException Error returned by the IntelliSoftware SMS gateway

Java Sample:


import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

IntelliSMS objIntelliSMS = new IntelliSMS();
objIntelliSMS.Username = "MyUsername";
objIntelliSMS.Password = "MyPassword";

int Balance = objIntelliSMS.GetBalance();

				

SendStatusCollection Object

Collection containing SendStatus objects for each recipient

Properties:

OverallResultCode Indicates the overall success/failure. See ResultCodes

Java Sample:

import IntelliSoftware.SMSGateway.SDK.IntelliSMSJavaSDK.*;

IntelliSMS objIntelliSMS = new IntelliSMS();
objIntelliSMS.Username = "MyUsername";
objIntelliSMS.Password = "MyPassword";

SendStatusCollection SendStatusList = objIntelliSMS.SendMessage ( "44771012345,44771023456", "Hello", "SENDER_ID" );
	
for ( int nIdx=0; nIdx<SendStatusList.size(); nIdx++ )
{
  SendStatus objSendStatus = SendStatusList.get(nIdx);

  if ( objSendStatus.ResultCode == ResultCodes.OK )
  {
    System.out.println( objSendStatus.To +
          " Sent OK     (" + objSendStatus.MessageId + ")" );
  }
  else
  {
    System.out.println( objSendStatus.To +
          " Sent Failed (" + objSendStatus.ResultCode + ")" );
  }
}

SendStatus Object

Provides the send status for a recipient.

Properties:

To Recipient's phone number that this status report is relevant
MessageId ID for this message.
ResultCode Indicates the success/failure of message submission for this recipient.
See ResultCodes

Result Codes

An enumeration that indicates the success/failure of a request.

enum ResultCodes

Values:

OK Request was successfully actioned
NoUsername Username was not supplied (Set Username property)
NoPassword Password was not supplied (Set Password property)
NoTo Message recipient(s) not specified
NoText Message text not specified
LoginInvalid MsgId parameter was missing
InsufficientCredit Insufficient credit available to complete the request
GatewayError An error occurred on remote gateway (please retry later)
InternalError An error occurred on remote gateway (please retry later)
HTTPConnectionError Unable to make HTTP connection to the Intellisoftware service
InvalidNumber The recipient number is invalid
InvalidRequest The request was invalid
MsgIdInvalid Supplied Message ID not valid
ParameterMissing Mandatory parameter is missing
ParameterInvalid A supplied parameter is invalid
AccountExists CreateSubaccount - subaccount already exists

IntelliSMSException Object

Represents error returned by the IntelliSoftware SMS Internet gateway.

Properties:

ResultCode

See ResultCodes

InnerException Provide additional information for a HTTPConnectionError

Advanced Features

Send to Distribution Lists (or Group Send)

Our gateway allows you to send SMS messages to preconfigured Distribution Lists or Groups. To send to a Distribution List or Group simply insert the Group Name were you would normally place the recipient's phone number. Distribution Lists or Groups are setup in your online account login on the Contacts page.

Reply Tracking:

The IntelliSoftware platform provides tracking of SMS replies, allowing you to determine which particular message a mobile user is replying to. When you submit a message to the SMS Gateway you can supply a User Context parameter. When a reply is received, the IntelliSoftware platform will included the User Context parameter when forwarding the message to your server.

The User Context can be supplied to the IntelliSoftware platform in the following ways:

.Net Component use SendMsgWithUserContext method
COM Component use SendMessageWithUserContext method
HTTP Interface add 'usercontext' POST/GET parameter
SMTP Interface (Email to SMS) add 'UserContext:' parameter
PHP SDK use SendMessageWithUserContext method
Java SDK use SendMessageWithUserContext method

The IntelliSoftware platform will forward the User Context for received messages in the following ways:

HTTP Interface 'usercontext' POST/GET parameter
SMTP Interface (SMS to Email) User Context appears in Subject line

Secure SSL Connection (HTTPS):

To use a secure internet connection configure the gateway addresses as follows:

objIntelliSMS.PrimaryGateway="https://www.intellisoftware.co.uk";
objIntelliSMS.BackupGateway="https://www.intellisoftware2.co.uk";

objIntelliSMS.SendMessage ( ......