Overview

Namespaces

  • None
  • PHP
  • tschiemer
    • Aspsms
      • Http
      • Soap
      • Xml

Classes

  • AbstractClient
  • AbstractSimpleClient
  • Request
  • Response
  • SimpleClient
  • Strings

Exceptions

  • ServiceException
  • Overview
  • Namespace
  • Class
  • Tree

Class SimpleClient

Simple interface combining all possible drivers.

Has an internal mapping of request names to drivers, thus drivers are loaded lazily as required.

tschiemer\Aspsms\AbstractSimpleClient
Extended by tschiemer\Aspsms\SimpleClient

Direct known subclasses

Aspsms
Namespace: tschiemer\Aspsms
Package: aspsms
Copyright: 2013 Philip Tschiemer, <tschiemer@filou.se>
License: v3 http://www.gnu.org/licenses/lgpl-3.0.txt
Version: 1.1.0
Link: https://github.com/tschiemer/aspsms-php
Located at lib/tschiemer/Aspsms/SimpleClient.php
Methods summary
public
# __construct( array $options = array() )

Constructor

Constructor

Sets up simple client and prepare for driver instantiation.

Driver options are passed as fields with names 'soapclient','httpclient','xmlclient' respectively.

The default request mapping can be changed when passing

Parameters

$options
array
$options

See

tschiemer\Aspsms\AbstractSimpleClient::__construct()
SoapClient::__construct()
HttpClient::__construct()
XmlClient::__construct()

Overrides

tschiemer\Aspsms\AbstractSimpleClient::__construct()
public tschiemer\Aspsms\AbstractClient
# driver( tschiemer\Aspsms\Request & $request )

Loads and returns the correct driver for the assigned request type.

Loads and returns the correct driver for the assigned request type.

Parameters

$request
tschiemer\Aspsms\Request
$requestType

Returns

tschiemer\Aspsms\AbstractClient

Throw

ServiceExceptionon
public Aspsms\class
# loadDriver( string $obj_name )

Instantiates driver with internal options.

Instantiates driver with internal options.

Parameters

$obj_name
string
$obj_name Driver name

Returns

Aspsms\class
Instance of driver

Throw

ServiceException
public array
# getVersion( )

Request: Get Soap or Http Service version (depends on assigned driver to use)

Request: Get Soap or Http Service version (depends on assigned driver to use)

Returns

array
Associative array with fields 'all','version','build' and corresponding meaning.
public string
# getStatusDescription( string|integer $statusCode )

Request: Get description to given status code.

Request: Get description to given status code.

Parameters

$statusCode
string|integer
$statusCode

Returns

string
public boolean
# sendMyToken( string $phoneNr, string $reference, string $verificationCode, string $message = '', integer $minutes = 5, boolean $case_sensitive = 0 )

Request: Send a token a predefined token to recipients.

Request: Send a token a predefined token to recipients.

Official doc:

If MessageData is set, the placeholder <VERIFICATIONCODE> will be substituted with the verification code. If MessageData is not defined, or if MessageData does not contain the placeholder <VERIFICATIONCODE>, only the verification code is sent.

Parameters

$phoneNr
string
$phoneNr Recipient phone number
$reference
string
$reference Your reference number
$verificationCode
string
$verificationCode Required verification code to send
$message
string
$message Message to send code with.
$minutes
integer
$minutes Validity of token in minutes (default 5)
$case_sensitive
boolean
$case_sensitive Is given code case sensitive?

Returns

boolean
Request success?
public boolean
# sendGeneratedToken( string $phoneNr, string $reference, string $message = '', string $mask = '######', integer $minutes = 5, boolean $case_sensitive = 0 )

Request: Send a token as generated by ASPSMS.COM, optionally give token mask.

Request: Send a token as generated by ASPSMS.COM, optionally give token mask.

Official doc:

If MessageData is set, the placeholder <VERIFICATIONCODE> will be substituted with the verification code. If MessageData is not defined, or if MessageData does not contain the placeholder <VERIFICATIONCODE>, only the verification code is sent.

Official doc:

Used to have the ASPSMS generate a verification code by mask. The mask can contain the following special characters:
# : a digit A : an alphabetic character N : an alphanumeric character
All other characters are taken literally. If not specified, the Mask is "NNNN" by default.

Parameters

$phoneNr
string
$phoneNr Recipient phone number
$reference
string
$reference Your reference number
$message
string
$message Message to send code with.
$mask
string
$mask Token code mask to use (# -> number, A -> Alphabetical)
$minutes
integer
$minutes Validity of token in minutes (default 5)
$case_sensitive
boolean
$case_sensitive Is given code case sensitive?

Returns

boolean
Request success?
public boolean
# validateToken( string $phoneNr, string $reference, string $verificationCode )

Request: attempt to validate token.

Request: attempt to validate token.

NOTE: If a token have been successfully validated, any future attempts (no matter the verification code use) succeed.

Parameters

$phoneNr
string
$phoneNr Recipient phone number
$reference
string
$reference Your reference number
$verificationCode
string
$verificationCode Required verification code to validate

Returns

boolean
Is given verification code for use valid?
public boolean
# sendVCard( array,string $recipients, string $name, string $phoneNr )

Send VCARD (name + telephone nr) to designated recipients.

Send VCARD (name + telephone nr) to designated recipients.

String Format: ("<RECIPIENT_NR>" + {":<TRACKING_NR>"} ";" .. )+ Eg: 00417777777 00417777777;00417777777;004177777777 00417777777:84612004;00417777777:74183874783

Array Format: <TRACKING_NR> => <RECIPIENT_NR>

Parameters

$recipients
array,string
$recipients
$name
string
$name Name of VCARD
$phoneNr
string
$phoneNr Phone number of VCARD

Returns

boolean
Request submitted successfully? (not delivery)

See

\Aspsms\AbstractSimpleClient::getDeliveryStatus()
public type
# sendRingtone( type $recipients, type $url )

Parameters

$recipients
type
$recipients
$url
type
$url

Returns

type
Methods inherited from tschiemer\Aspsms\AbstractSimpleClient
callbacks(), checkOriginator(), clear(), deferTime(), deferUntil(), flash(), getAffiliateId(), getCallbackURL(), getCreditBalance(), getDeliveryStatus(), getLastRequest(), getLastResponse(), getLastStatusCode(), getOriginator(), requestOriginatorUnlockCode(), send(), sendText(), sendWapPush(), set(), setAffiliateId(), setAuth(), setCallbackURL(), setOriginator(), unlockOriginator()
Properties summary
public tschiemer\Aspsms\AbstractClient[] $drivers NULL
#

Loaded drivers

Loaded drivers

public array $driverOptions array( 'soap' => array(), 'http' => array(), 'xml' => array() )
#

Driver options to use when instantiating drivers .

Driver options to use when instantiating drivers .

See

HttpClient, SoapClient, XmlClient
public string[] $requestMap array( 'getVersion' => 'http', // Soap|Http 'getCredits' => 'http', // Xml|Soap|Http 'getStatusCodeDescription' => 'http', // Soap|Http 'checkOriginator' => 'http', // Xml|Soap|Http 'sendOriginatorCode' => 'http', // Xml|Soap|Http 'unlockOriginator' => 'http', // Xml|Soap|Http 'sendText' => 'http', // Xml|Soap|Http 'sendWapPush' => 'http', // Xml|Soap|Http 'sendToken' => 'http', // Soap|Http 'verifyToken' => 'http', // Soap|Http 'sendPicture' => 'xml', // Xml 'sendLogo' => 'xml', // Xml 'sendGroupLogo' => 'xml', // Xml 'sendRingtone' => 'xml', // Xml 'sendVCard' => 'xml', // Xml 'sendBinaryData' => 'xml', // Xml 'getDeliveryStatus' => 'http', // Xml|Soap|Http )
#

Mapping of request names to driver names

Mapping of request names to driver names

Properties inherited from tschiemer\Aspsms\AbstractSimpleClient
$affiliateId, $currentRequest, $lastRequest, $lastResponse, $originator, $password, $urls, $userkey
aspsms-php API documentation generated by ApiGen 2.8.0