2017 © Pedro Peláez
 

library exacttarget-client

Easy way to interact with ExactTarget REST API in Laravel

image

leroy-merlin-br/exacttarget-client

Easy way to interact with ExactTarget REST API in Laravel

  • Wednesday, June 22, 2016
  • by GuilhermeGuitte
  • Repository
  • 21 Watchers
  • 0 Stars
  • 3,105 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

ExactTarget API wrapper for PHP, Laravel 5.* and 4.2

A wrapper to ExactTarget REST API., (*1)

Get started

[TODO], (*2)

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());
}

The Versions

22/06 2016

dev-develop

dev-develop

Easy way to interact with ExactTarget REST API in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest sdk salesforce exacttarget

22/06 2016

v0.1.0

0.1.0.0

Easy way to interact with ExactTarget REST API in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest sdk salesforce exacttarget

28/08 2015

dev-master

9999999-dev

Easy way to interact with ExactTarget REST API in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel api rest sdk salesforce exacttarget