NAME

Net::SMS::Clickatell::SOAP - Clickatell SMS service via SOAP

SYNOPSIS

use SMS::Clickatell::SOAP;

my $sms = new SMS::Clickatell::SOAP(
	connection => (
		proxy => $PROXY_URL,
		service => $SERVICE_URL,
		verbose => $VERBOSE,
		user	=> $WS_USER,
		password => $WS_PASSWD,
		api_id => 123456,
	)
);

DESCRIPTION

Pure Perl methods to interface with the Clickatell Bulk SMS service.

EXPORT

ping
sendMsg
queryMsg
stopMsg
queryBalance
queryCoverage

METHODS

new()

Class constructor method instantiates a class object and initiates a connection to the Clickatell service through the auth call.

usage

 my $hSMS = new SMS::Clickatell::SOAP(
 	api_id => $apiId,
	user	=> $user,
	password => $password,
 	proxy   => $endpoint,
 	service => "${endpoint}?wsdl",
	verbose => 0
 );
api_id (required)

Clickatell assigned api_id value.

user (required)

Clickatell account user ID.

password (required)

Clickatell account password.

proxy (optional)

SOAP connection parameter. See SOAP::Lite for further information. Defaults to http://api.clickatell.com/soap/webservice.php.

service (optional)

SOAP connection parameter. See SOAP::Lite for further information. Defaults to http://api.clickatell.com/soap/webservice.php?wsdl.

verbose

Verbosity level for debugging. Default is verbose=>0 (only error output).

ping()

Send a ping to the service to keep the session alive.

Usage

my $resp = $hSMS->ping();

Returns

OK:
error message

getbalance()

Query the number of credits available in the account.

Usage

my $resp = $hSMS();

Returns

Credit: nn.nnn

Amount of outstanding credit balance for the account.

error message

None.

routeCoverage()

Chck the coverage of a network or number without sending a message.

Usage

 my $resp = $hSMS->routeCoverage(
	msisdn => $msisdn
 );
msisdn

The network or number to be checked for coverage.

Returns

OK: followed by coverage information

Eg. OK: This prefix is currently supported. Messages sent to this prefix will be routed. Charge: 0.33

error message

querymsg()

Query the status of a message.

Usage

$resp = $hSMS->querymsg( apiMsgId => $apiMsgId ); $resp = $hSMS->querymsg( cliMsgId => $cliMsgId );

apiMsgId

API message id (apiMsgId) returned by the gateway after a message was sent.

cliMsgId

client message ID (cliMsgId) you used on submission of the message.

Returns

ID: followed by message status

eg. ID: 18e8221e5aa50cfad72376e08f40388a Status: 001;

Status codes are defined by the Clickatell API.

error message

querymsg()

Query the status of a message.

Usage

$resp = $hSMS->querymsg( apiMsgId => $apiMsgId );

apiMsgId

API message id (apiMsgId) returned by the gateway after a message was sent.

Returns

apiMsgId: followed by message status

eg. apiMsgId: 18e8221e5aa50cfad72376e08f40388a charge: 0.33 status: 004;

Status codes are defined by the Clickatell API.

error message

delmsg()

Delete a previously sent message.

Usage

$resp = $hSMS->delmsg( apiMsgId => $apiMsgId ); $resp = $hSMS->delmsg( cliMsgId => $cliMsgId );

apiMsgId

API message id (apiMsgId) returned by the gateway after a message was sent.

cliMsgId

client message ID (cliMsgId) you used on submission of the message.

Returns

ID: followed by message status

eg. ID: 18e8221e5aa50cfad72376e08f40388a Status: 001;

Status codes are defined by the Clickatell API.

error message

sendmsg()

Chck the coverage of a network or number without sending a message. If item_user is supplied, then preexisting session authentication (if any) will be ignored and the item_user, item_pasword and api_id values will be used to authenticate this call. This allows you to send a message even if the existing session has dropped for any reason.

The default (no item_user supplied) is to use the established session.

Usage

$resp = $hSMS->sendmsg(to => '19991234567', text => 'Hello there...'); $resp = $hSMS->sendmsg(to => @phoneNumbers, text => 'Hello there...');

to (required)

A phone number or list of phone numbers to recieve the messsage

text (required)

The text of the message to be sent

api_id (not implemented yet)
user (not implemented yet)
password (not implemented yet)
from (not implemented yet)
concat (not implemented yet)
deliv_ack (not implemented yet)
callback (not implemented yet)
deliv_time (not implemented yet)
max_credits (not implemented yet)
req_feat (not implemented yet)
queue (not implemented yet)
escalate (not implemented yet)
mo (not implemented yet)
cliMsgId (not implemented yet)
unicode (not implemented yet)
msg_type (not implemented yet)
udh (not implemented yet)
data (not implemented yet)
validity (not implemented yet)

Returns

ID: followed by message id

eg. ID: 18e8221e5aa50cfad72376e08f40388a;

Status codes are defined by the Clickatell API.

ERR: followed by an error message

e.g. ERR: 105, Invalid Destination Address;

SEE ALSO

SOAP::Lite, Clickatell SOAP API Specification V 1.1.8

AUTHOR

Peter Farr <peter.farr@lpi-solutions.com>

COPYRIGHT AND LICENSE

This software is supplied as is with no warranty. The software is licensed under the terms of the Creative Commons Attribution 3.0 Unported license (http://creativecommons.org/licenses/by/3.0/deed.en_CA).

Copyright Peter Farr, 2010.

This module is part of SMS::Clickatell