Class dosamigos\nexmo\Account

Inheritancedosamigos\nexmo\Account » dosamigos\nexmo\Client » yii\base\Component
Class Account handles interaction with your Nexmo account.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$api string API endpoint dosamigos\nexmo\Client
$format string Response format. dosamigos\nexmo\Client
$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
buyNumber() Purchase a given inbound number. dosamigos\nexmo\Account
cancelNumber() Cancel a given inbound number subscription. dosamigos\nexmo\Account
getBalance() Retrieve your current account balance. dosamigos\nexmo\Account
getNumbers() Get all inbound numbers associated with your Nexmo account. dosamigos\nexmo\Account
getPricing() Retrieve our outbound pricing for a given country. dosamigos\nexmo\Account
init() Initializes the object. dosamigos\nexmo\Client
searchMessage() Search a previously sent message for a given message id. Please note a message become searchable a few minutes after submission for real-time delivery notification implement our DLR call back. dosamigos\nexmo\Account
searchMessagesByDate() Search sent messages. Please note a message become searchable a few minutes after submission for real-time delivery notification implement the DLR call back. dosamigos\nexmo\Account
searchMessagesByIds() Search sent messages. Please note a message become searchable a few minutes after submission for real-time delivery notification implement the DLR call back. dosamigos\nexmo\Account
searchNumbers() Get available inbound numbers for a given country. dosamigos\nexmo\Account
searchRejections() Search rejected messages. Please note a message become searchable a few minutes after submission. dosamigos\nexmo\Account
topUp() Top-up your account, only if you have turn-on the 'auto-reload' feature. The top-up amount is the one associated with your 'auto-reload' transaction. dosamigos\nexmo\Account
updateNumber() Update your number callback. dosamigos\nexmo\Account
updateSettings() Update your account settings. dosamigos\nexmo\Account

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getAcceptHeaderOption() Returns the Accept header according to the format selected dosamigos\nexmo\Account
getGuzzleClient() Returns the guzzle client dosamigos\nexmo\Client
getUrl() Returns the formed api call dosamigos\nexmo\Account
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

Method Details

buyNumber() public method

Purchase a given inbound number.

See also https://docs.nexmo.com/index.php/developer-api/number-buy.

string buyNumber$country$msisdn )
$country string

Country code. Ex: ES

$msisdn string

An available inbound number Ex: 34911067000

return string

The status code. Possible values: - 200 if successful purchase - 401 if wrong credentials - 420 if wrong parameters

cancelNumber() public method

Cancel a given inbound number subscription.

See also https://docs.nexmo.com/index.php/developer-api/number-cancel.

string cancelNumber$country$msisdn )
$country string

Country code. Ex: CA

$msisdn string

One of your inbound numbers Ex: 34911067000

return string

The status code. Possible values: - 200 if successful cancellation - 401 if wrong credentials - 420 if wrong parameters

getAcceptHeaderOption() protected method

Returns the Accept header according to the format selected

array getAcceptHeaderOption( )
getBalance() public method

Retrieve your current account balance.

See also https://docs.nexmo.com/index.php/developer-api/account-get-balance.

mixed|null getBalance( )
getNumbers() public method

Get all inbound numbers associated with your Nexmo account.

See also https://docs.nexmo.com/index.php/developer-api/account-numbers.

mixed getNumbers$index null$size null$pattern null )
$index int

Page index (>0, default 1). Ex: 2

$size int

Page size (max 100, default 10). Ex: 25

$pattern string

Page size (max 100, default 10). Ex: 25

getPricing() public method

Retrieve our outbound pricing for a given country.

See also https://docs.nexmo.com/index.php/developer-api/account-pricing.

mixed getPricing$country )
$country string

A 2 letter country code. Ex: CA

getUrl() protected method

Returns the formed api call

string getUrl$command )
$command string

The command key

return string

The api url call

searchMessage() public method

Search a previously sent message for a given message id. Please note a message become searchable a few minutes after submission for real-time delivery notification implement our DLR call back.

See also https://docs.nexmo.com/index.php/developer-api/search-message.

mixed searchMessage$id )
$id string

Your message id received at submission time Ex: 00A0B0C0

searchMessagesByDate() public method

Search sent messages. Please note a message become searchable a few minutes after submission for real-time delivery notification implement the DLR call back.

See also https://docs.nexmo.com/index.php/developer-api/search-messages.

mixed searchMessagesByDate$date$to )
$date string

Message date submission YYYY-MM-DD Ex: 2011-11-15

$to string

A recipient number Ex: 1234567890

searchMessagesByIds() public method

Search sent messages. Please note a message become searchable a few minutes after submission for real-time delivery notification implement the DLR call back.

See also https://docs.nexmo.com/index.php/developer-api/search-messages.

mixed searchMessagesByIds$ids )
$ids array

A list of message ids, up to 10 Ex: ['00A0B0C0','00A0B0C1','00A0B0C2']

searchNumbers() public method

Get available inbound numbers for a given country.

See also https://docs.nexmo.com/index.php/developer-api/number-search.

mixed searchNumbers$country$pattern null$features null$index null$size null )
$country string

Country code. Ex: CA

$pattern string

A matching pattern. Ex: 888

$features string

Available features are SMS and VOICE, use a comma-separated values. Ex: SMS,VOICE

$index int

Page index (>0, default 1). Ex: 2

$size int

Page size (max 100, default 10). Ex: 25

searchRejections() public method

Search rejected messages. Please note a message become searchable a few minutes after submission.

mixed searchRejections$date$to null )
$date string

Message date submission YYYY-MM-DD Ex: 2011-11-15

$to string

A recipient number Ex: 1234567890

topUp() public method

Top-up your account, only if you have turn-on the 'auto-reload' feature. The top-up amount is the one associated with your 'auto-reload' transaction.

See also https://docs.nexmo.com/index.php/developer-api/account-top-up.

string topUp$transactionId )
$transactionId string

The transaction id associated with your first 'auto reload' top-up. Ex: 00X123456Y7890123Z

return string

The status code. Possible responses: - 200 if successful top-up - 401 if not authorized to perform the request - 420 if top-up failed

updateNumber() public method

Update your number callback.

See also https://docs.nexmo.com/index.php/developer-api/number-update.

string updateNumber$country$msisdn$mHttpUrl null$moSmppSysType null$voiceCallbackType null$voiceCallbackValue null )
$country string

Country code. Ex: ES

$msisdn string

One of your inbound numbers Ex: 34911067000

$mHttpUrl string

The URL should be active to be taken into account Ex: http://mycallback.servername

$moSmppSysType string

The associated system type for SMPP client only Ex: inbound

$voiceCallbackType string

The voice callback type for SIP end point (sip), for a telephone number (tel), for VoiceXML end point (vxml)

$voiceCallbackValue string

The voice callback value based on the voiceCallbackType

updateSettings() public method

Update your account settings.

See also https://docs.nexmo.com/index.php/developer-api/account-settings.

mixed|null updateSettings$newSecret null$moCallBackUrl null$drCallBackUrl null )
$newSecret string

Your new API secret (8 characters max)

$moCallBackUrl string

Inbound call back URL. The URL should be active to be taken into account Ex: http://mycallback.servername

$drCallBackUrl string

DLR call back URL. The URL should be active to be taken into account and Ex: http://mycallback.servername

throws \yii\base\InvalidParamException