Class dosamigos\nexmo\Sms

Inheritancedosamigos\nexmo\Sms » dosamigos\nexmo\Client » yii\base\Component
Class Sms handles the methods and properties of sending a SMS message through your Nexmo account.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$api string API endpoint dosamigos\nexmo\Client
$format string Response format. dosamigos\nexmo\Client
$from string The sender address. dosamigos\nexmo\Sms
$key string Your API key dosamigos\nexmo\Client
$secret string Your API secret dosamigos\nexmo\Client

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$uri string The formed uri by child classes dosamigos\nexmo\Client

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getUrl() dosamigos\nexmo\Sms
init() Initializes the object. dosamigos\nexmo\Sms
sendBinary() Sends a binary message dosamigos\nexmo\Sms
sendPushWAP() Sends a Push WAP message dosamigos\nexmo\Sms
sendText() Sends a text message dosamigos\nexmo\Sms

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getEncodedParams() All requests require UTF-8 encoding dosamigos\nexmo\Sms
getGuzzleClient() Returns the guzzle client dosamigos\nexmo\Client
getValidatedFrom() If the originator ('from' field) is invalid, some networks may reject the network whilst stinging you with the financial cost! While this cannot correct them, it will try its best to correctly format them. dosamigos\nexmo\Sms
request() Makes a Url request and returns its response dosamigos\nexmo\Client
validateUTF8() Validates whether the value is UTF8 encoded and if not, it encodes it. dosamigos\nexmo\Client

Property Details

$from public property
string $from null

The sender address. It can be alphanumeric. Restrictions may apply, depending on the destination.

See also http://help.nexmo.com/categories/7470-faq.

Method Details

getEncodedParams() protected method

All requests require UTF-8 encoding

array getEncodedParams$params )
$params array
getUrl() public method

string getUrl( )
return string

The api url call

getValidatedFrom() protected method

If the originator ('from' field) is invalid, some networks may reject the network whilst stinging you with the financial cost! While this cannot correct them, it will try its best to correctly format them.

string getValidatedFrom( )
return string

The validated from

init() public method

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

void init( )
throws \yii\base\InvalidConfigException
sendBinary() public method
mixed|null sendBinary$to$body$udh )
$to string

The mobile number in international format. Ex: 447525856424 or 00447525856424 to UK.

$body string

The content of the message.

$udh string

The user data header. Ex: udh=06050415811581.

sendPushWAP() public method
mixed|null sendPushWAP$to$url$title$validity null )
$to string

The mobile number in international format. Ex: 447525856424 or 00447525856424 to UK.

$url string

The WAP Push URL. Ex: url=http://www.mysite.com

$title string

The title of WAP Push. Ex: title=MySite

$validity integer

Sets how long WAP Push is available in milliseconds. Ex: validity=86400000 Default: 48 hours: 172800000

sendText() public method
mixed|null sendText$to$text$params = [] )
$to string

The mobile number in international format. Ex: 447525856424 or 00447525856424 to UK.

$text string

The body of the text message (with a maximum length of 3200 chars)

$params array

Optional parameters to be attached to the call.

return mixed|null

The request response