Class dosamigos\nexmo\Account
Inheritance | dosamigos\nexmo\Account » 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 |
$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 |
---|---|---|
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
Method | Description | Defined 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
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 |
---|
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 |
---|
Returns the Accept header according to the format selected
array getAcceptHeaderOption( ) |
Retrieve your current account balance.
See also https://docs.nexmo.com/index.php/developer-api/account-get-balance.
mixed|null getBalance( ) |
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 |
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 |
Returns the formed api call
string getUrl( $command ) | ||
$command | string | The command key |
return | string | The api url call |
---|
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 |
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 |
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'] |
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 |
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 |
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 |
---|
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 |
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 |
---|