Class dosamigos\nexmo\Sms
Inheritance | dosamigos\nexmo\Sms » dosamigos\nexmo\Client » yii\base\Component |
---|
Public Properties
Property | Type | Description | Defined 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
Property | Type | Description | Defined By |
---|---|---|---|
$uri | string | The formed uri by child classes | dosamigos\nexmo\Client |
Public Methods
Method | Description | Defined 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
Method | Description | Defined 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
The sender address. It can be alphanumeric. Restrictions may apply, depending on the destination.
Method Details
All requests require UTF-8 encoding
array getEncodedParams( $params ) | ||
$params | array |
string getUrl( ) | ||
return | string | The api url call |
---|
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 |
---|
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 |
---|
Sends a binary message
See also https://docs.nexmo.com/index.php/how-to/send-binary-message.
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. |
Sends a Push WAP message
See also https://docs.nexmo.com/index.php/how-to/send-wap-push-message.
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 |
Sends a text message
See also https://docs.nexmo.com/index.php/sms-api/send-message.
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 |
---|