PHP Class Mailjet\Client

Author: Guillaume Badi ([email protected])
Afficher le fichier Open project: mailjet/mailjet-apiv3-php Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $key, string $secret, boolean $call = true ) Client constructor requires:
delete ( array $resource, array $args = [] ) : Response Trigger a GET request
get ( array $resource, array $args = [] ) : Response Trigger a GET request
post ( array $resource, array $args = [] ) : Response Trigger a POST request
put ( array $resource, array $args = [] ) : Response Trigger a POST request
setSecureProtocol ( boolean $bIsSecured ) : boolean Sets if we need to use https or http protocol while using API Url

Private Methods

Méthode Description
_call ( string $method, string $resource, string $action, array $args ) : Response Magic method to call a mailjet resource
buildURL ( string $resource, string $action, string $id, string $actionid ) : string Build the final call url without query strings
getApiUrl ( ) : string Build the base API url depending on wether user need a secure connection or not

Method Details

__construct() public méthode

Client constructor requires:
public __construct ( string $key, string $secret, boolean $call = true )
$key string Mailjet API Key
$secret string Mailjet API Secret
$call boolean performs the call or not

delete() public méthode

Trigger a GET request
public delete ( array $resource, array $args = [] ) : Response
$resource array Mailjet Resource/Action pair
$args array Request arguments
Résultat Response

get() public méthode

Trigger a GET request
public get ( array $resource, array $args = [] ) : Response
$resource array Mailjet Resource/Action pair
$args array Request arguments
Résultat Response

post() public méthode

Trigger a POST request
public post ( array $resource, array $args = [] ) : Response
$resource array Mailjet Resource/Action pair
$args array Request arguments
Résultat Response

put() public méthode

Trigger a POST request
public put ( array $resource, array $args = [] ) : Response
$resource array Mailjet Resource/Action pair
$args array Request arguments
Résultat Response

setSecureProtocol() public méthode

Sets if we need to use https or http protocol while using API Url
public setSecureProtocol ( boolean $bIsSecured ) : boolean
$bIsSecured boolean True use https / false use http
Résultat boolean true if we set value false otherwise