Class dosamigos\nexmo\Client
Inheritance | dosamigos\nexmo\Client » yii\base\Component |
---|---|
Subclasses | dosamigos\nexmo\Account, dosamigos\nexmo\Sms |
Class Client is the base class of Components that access the API and handles the calls to the API base end point.
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 |
---|---|---|
init() | Initializes the object. | dosamigos\nexmo\Client |
Protected Methods
Method | Description | Defined By |
---|---|---|
getGuzzleClient() | Returns the guzzle client | dosamigos\nexmo\Client |
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
API endpoint
Response format. Can be json or xml.
Your API key
Your API secret
The formed uri by child classes
Method Details
Returns the guzzle client
\GuzzleHttp\Client getGuzzleClient( ) |
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 |
---|
Makes a Url request and returns its response
mixed|null request( $url, $params = [], $options = [] ) | ||
$url | string | The uri to call |
$params | array | The parameters to be bound to the call |
$options | array | The options to be attached to the client |
Validates whether the value is UTF8 encoded and if not, it encodes it.
From Nexmo Docs: All requests are submitted through the HTTP POST or GET method using UTF-8 encoding and URL encoded values.
string validateUTF8( $value ) | ||
$value | string |