category |
OSS |
package |
OSS_Service |
subpackage |
Clickatell |
copyright |
Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland |
license |
New BSD License |
Methods
Constructor
__construct(\$options $options) : void
Accepted associated array parameters:
api_url use_ession
Also see parent constructor for additional options.
Parameters
$options
\$options
array An associated array of options (see above for accepted keys).
Get the API ID
getApiId() : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getApiId() |
Returns
string
Get the API URL
getApiUrl() : string
Get the Clickatell account balance.
getBalance() : string
This returns the number of credits remaining.
Exceptions
Returns
string
Get the text description for a given state
getMessageStateDescription(string $state) : void
Inherited
Parameters
$state
string
The state to query
Get the password
getPassword() : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getPassword() |
Returns
string
Is SSL enabled?
Returns a boolean indicating whether SSL is enabled or not
getSSL() : bool
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getSSL() |
Returns
bool
Get the last batch of send errors
getSendErrors() : array
Inherited
Returns an associated array of number => error_message where number is the destination SMS
number and error is that as returned from the Clickatell API.
inherited_from |
\OSS_Service_Clickatell_Abstract::getSendErrors() |
Returns
array
Get the last batch of send IDs
getSendIds() : array
Inherited
Returns an associated array of number => ID where number is the destination SMS
number and ID is the send ID from the Clickatell API.
inherited_from |
\OSS_Service_Clickatell_Abstract::getSendIds() |
Returns
array
Should we use sessions?
Returns true if we will use sessions
getUseSession() : bool
Get the username
getUsername() : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getUsername() |
Returns
string
Query the status of a message previously sent.
queryMessage(\$msgid $msgid)
Use OSS_Service_Clickatll_Abstract::$MESSAGE_STATES and OSS_Service_Clickatll_Abstract::getMessageStateDescription()
to interpret the state.
Parameters
$msgid
\$msgid
string The message ID to query
Exceptions
Send a one off SMS to a single or multiple users
sendSms(string | array $number, string $message, string $senderid) : bool
If $number is an array, then the SMS will be sent to multple users.
The success IDs or send errors will be found referenced by the destination number
via getSendIds() and getSendErrors().
You cannot just use any sender id you like, first you have to register and approve it by Clickatell.
Return true if all messages sent successfully, false if there were errors (@see OSS_Service_Clickatell_Abstract::$_send_errors)
Parameters
$number
string
array
The full international version of the number to send the SMS to (or an array of multiple numnbers)
$message
string
The message to send
$senderid
string
NULL to use the default from application.ini, false to not to use any, a valid international format number between 1 and 16 characters long, or an 11 character alphanumeric string
Returns
bool
Set the API ID
setApiId(\$api_id $api_id) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::setApiId() |
Parameters
$api_id
\$api_id
the API ID to set
Set the API URL
setApiUrl(\$api_url $api_url) : void
Parameters
$api_url
\$api_url
the API ID to set
Sets the authentication params for the URI on the HTTP client object
setAuthParams() : void
Specifically, if we are using sessions, then a session ID parameter will
be set, otherwise we'll set a username, password and API ID.
Set the log level
setLogLevel(int $loglevel) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::setLogLevel() |
Parameters
$loglevel
int
The log level
Set the logger object
setLogger(\Zend_Logger $logger) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::setLogger() |
Parameters
$logger
\Zend_Logger
The Zend_Logger object
Set the API password
setPassword(\$password $password) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::setPassword() |
Parameters
$password
\$password
the password to set
Set SSL enabled
setSSL(\$ssl $ssl) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::setSSL() |
Parameters
$ssl
\$ssl
Pass boolean true to set SSL enabled
Should we use sessions?
setUseSession(\$api_url $use_session) : void
Parameters
$use_session
\$api_url
the API ID to set
Set the username parameter
setUsername(\$username $username)
Inherited
retrn |
void |
inherited_from |
\OSS_Service_Clickatell_Abstract::setUsername() |
Parameters
$username
\$username
The username to set
A generic function to place API calls and catch common errors early (e.g.
call(string $method) : void
Parameters
$method
string
The method to call (see OSS_Service_Clickatell_Http::API_METHOD_XXX)
Exceptions
Get the log level
getLogLevel() : int
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getLogLevel() |
Returns
int
Get the logger object
getLogger() : \Zend_Logger
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::getLogger() |
Returns
\Zend_Logger
Add an entry to the log
log(string $log) : void
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::log() |
Parameters
Properties
An array of Clickatell delivery states (e.g.
$MESSAGE_STATES : array
Inherited
@see OSS_Service_Clickatell_Http::getQueryMessage() )
inherited_from |
\OSS_Service_Clickatell_Abstract::$$MESSAGE_STATES |
API access ID
$_api_id : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_api_id |
The API URL for Clickatell
$_api_url : string
A logger object
$_logger : \Zend_Logger
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_logger |
The log level
$_loglevel : integer
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_loglevel |
API access password
$_password : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_password |
HTTP reponse object
$_response : object
An array of errors per phone number from the last send
Keys are the numbers and values are the error messages
$_send_errors : array
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_send_errors |
Send IDs of the last batch of messages sent
Keys are the numbers and values are the IDs
$_send_ids : array
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_send_ids |
A string containing the Sender ID, which is a short ( <= 11 characters) string
$_sender_id : string
Use an SSL connection?
$_ssl : bool
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_ssl |
Use sessions or authenticate for each request
$_use_session : bool
API access username
$_username : string
Inherited
inherited_from |
\OSS_Service_Clickatell_Abstract::$$_username |
Constants
API identifiers for different tasks
API_METHOD_BALANCE
API_METHOD_QUERY
API_METHOD_QUERY
API_METHOD_SENDSMS
API_METHOD_SENDSMS
Features.
FEAT_8BIT
for more than one feature request add the values up and pass the sum (FEAT_8BIT + FEAT_ALPHA + FEAT_CONCAT)
FEAT_DELIVACK
FEAT_DELIVACK