leroy-merlin-br / exacttarget-client
Easy way to interact with ExactTarget REST API in Laravel
Installs: 9 806
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 24
Forks: 3
Open Issues: 0
Requires
- php: ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4.5
- illuminate/config: ^9.0 || ^10.0
- illuminate/support: ^9.0 || ^10.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-11-11 19:10:13 UTC
README
A wrapper to ExactTarget REST API.
Get started
[TODO]
Usage
Vanilla PHP
<?php $guzzleClient = new \GuzzleHttp\Client(); $requestBuilder = new \LeroyMerlin\ExactTarget\RequestBuilder($guzzleClient); $token = new \LeroyMerlin\ExactTarget\Token('YOUR_CLIENT_ID', 'YOUR_CLIENT_SECRET', $requestBuilder); $client = new \LeroyMerlin\ExactTarget\Client($token, $requestBuilder); $parameters = [ // optional // 'some-url-param' => 'some-value' 'data' => [ 'email' => 'johndoe@example.com', 'validators' => ['SyntaxValidator', 'MXValidator', 'ListDetectiveValidator'], ], ]; try { $response = $client->validateEmail($parameters); var_dump((string) $response->getBody()); } catch (\LeroyMerlin\ExactTarget\Exception\ExactTargetClientException $error) { var_dump($error->getCode(), $error->getMessage()); }
Laravel 5.*
$client = app(\LeroyMerlin\ExactTarget\Client::class); // As in https://code.exacttarget.com/apis-sdks/rest-api/v1/address/validateEmail.html $parameters = [ // optional // 'some-url-param' => 'some-value' 'data' => [ 'email' => 'johndoe@example.com', 'validators' => ['SyntaxValidator', 'MXValidator', 'ListDetectiveValidator'], ], ]; try { $response = $client->validateEmail($parameters); var_dump((string) $response->getBody()); } catch (\LeroyMerlin\ExactTarget\Exception\ExactTargetClientException $error) { var_dump($error->getCode(), $error->getMessage()); }
Laravel 4.2
$client = App::make('LeroyMerlin\ExactTarget\Client'); // As in https://code.exacttarget.com/apis-sdks/rest-api/v1/address/validateEmail.html $parameters = [ // optional // 'some-url-param' => 'some-value' 'data' => [ 'email' => 'johndoe@example.com', 'validators' => ['SyntaxValidator', 'MXValidator', 'ListDetectiveValidator'], ], ]; try { $response = $client->validateEmail($parameters); var_dump((string) $response->getBody()); } catch (\LeroyMerlin\ExactTarget\Exception\ExactTargetClientException $error) { var_dump($error->getCode(), $error->getMessage()); }