2017 © Pedro Peláez
 

library exacttarget-laravel

The best way to talk to Exact Target with Hypertext PreProcessor

image

digitaladditive/exacttarget-laravel

The best way to talk to Exact Target with Hypertext PreProcessor

  • Thursday, July 12, 2018
  • by patrickisgreat
  • Repository
  • 3 Watchers
  • 3 Stars
  • 1,637 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 21 Versions
  • 2 % Grown

The README.md

A Simple API for connecting a Laravel app to Exact Target

Build Status, (*1)

This Laravel package provides a collection of methods for clean and easy interaction with the all new Exact Target REST API as well as methods for use with Fuel SDK., (*2)

It implements the following Contract which explains what is currently available for use in your Controllers or models. You can get a good idea of what each one will do just from the comments. This is a work in progress and there are many more endpoints to make methods for., (*3)

This build includes one implementation for Laravel., (*4)

<?php
    interface EtInterface {
    /**
    * reaches out to Exact Target Rest API with client secret and Id
    * returns the auth token
    *
    * Client is the guzzle object and all the methods you need
    *
    * @param $clientId
    * @param $clientSecret
    * @param $getTokenUri
    * @param Client $client
    * @return array
    */
    public function getToken($clientId, $clientSecret, $getTokenUri);

    /**
    * POST
    *
    * /dataevents/key:{key}/rowset
    *
    * Upserts a batch of data extensions rows by key.
    *
    * @param $keys
    * @param $values
    * @param Client $client
    * @return array
    */
    public function upsertRowset($values, $deKey);

    /**
    * SOAP WDSL
    *
    * uses the Fuel SDK to delete a row by Primary Key
    * currently the v1 of the REST api does not support retrieval of data.
    * Hopefully this will change in the near future
    *
    * @param $deName
    * @param $props
    * @return array -- the response from Exact Target
    */
    public function deleteRow($deName, $props);

    /**
    * @param $deName
    *  Required -- Name of the Data Extension to query
    *
    * @return array
    */
    public function getDeColumns($deName);

    /**
    * SOAP WDSL
    *
    * uses the Fuel SDK to grab all the rows of a given Data Extension
    * currently the v1 of the REST api does not support retrieval of data.
    * Hopefully this will change in the near future
    *
    *
    * @param $keyName
    *  This is an optional param if set along with primaryKey the result will be filtered to a single row by PrimaryKey
    * @param $primaryKey
    *  This is an optional param if set along with keyName the result will be filtered to a single row by PrimaryKey
    * @param $deName
    *  Required -- Name of the Data Extension to query
    * @return array
    *  Response from ET
    */
    public function getRows($deName, $keyName='', $primaryKey='');

    /**
    * POST
    *
    * Asynchronously upserts a batch of data extensions rows by key.
    *
    * these async methods need testing when / if we have a need for async requests (which we will)
    *
    * /dataeventsasync/key:{key}/rowset
    *
    */
    public function asyncUpsertRowset($keys, $values, $deKey);

    /**
    * PUT
    *
    * Upserts a data extension row by key.
    *
    * /dataevents/key:{key}/rows/{primaryKeys}
    */
    public function upsertRow($pKey, $pVal, $values, $deKey);

    /**
    * PUT
    *
    * Asynchronously upserts a data extension row by key.
    *
    * these async methods need testing when / if we have a need for async requests (which we will)
    *
    * /dataeventsasync/key:{key}/rows/{primaryKeys}
    */
    public function asyncUpsertRow($pKey, $pVal, $values, $deKey);

    /**
    * Create a Data extension by passing an array of DE Name keys => Column props values.
    *
    * @param $deStructures
    * @return array (response)
    */
    public function createRow($deName, $props);

    /**
    * POST
    *
    * To validate an email address, perform an HTTP POST specifying the email address and validators
    * to be used in the payload of the HTTP POST. You can use more than one validator in the same call.
    *
    * /validateEmail
    *
    */
    public function validateEmail($email);

    /**
    * Create a Data extension by passing an array of DE Name keys => Column props values.
    *
    * @param $deStructures
    * @return array (response)
    */
    public function createDe($deStructures)

}

Installation

Begin by installing this package through Composer. Edit your project's composer.json file to require digitaladditive/exacttargetlaravel. Or just run composer require digitaladditive/exacttargetlaravel, (*5)

"require-dev": {
    "digitaladditive/ExactTargetLaravel": "~1.1"
}

Next, update Composer from the Terminal:, (*6)

composer update --dev

Next, You will have to fill out your Exact Target CLIENT_ID and CLIENT_SECRET within the ExactTargetLaravelConfig.php file located in the root of this package with your Exact Target API credentials., (*7)

Make sure you have 'mcrypt' installed an enabled on your web server or Fuel SDK calls will fail, (*8)

Now just write a use statement at the top of your Laravel app files like so:, (*9)

use digitaladditive/ExactTargetLaravel/LaravelEtApi;

Usage

A few usage examples, (*10)


<?php /* asynchronously upsert a batch of Rows to a DE*/ return $this->etConnect()->asyncUpsertRowset(["primaryKey" => 1], ["emailAddress" => "newemail@newemail.com"], 'TestingRest '); /* upsert a single row to a DE */ return $this->etConnect()->upsertRow('primaryKey', 1, ['emailAddress' => 'oncemore@oncemore.com'], 'TestingRest'); /* Validate an Email address */ return $this->etConnect()->validateEmail('patrickisgreat@gmail.com'); /* Delete a Row from a DE */ return $this->etConnect()->deleteRow('TestingRest', ['primaryKey' => 1]);

The Versions

12/07 2018

dev-master

9999999-dev https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

12/07 2018
12/07 2018

dev-implements-databroadcast-event

dev-implements-databroadcast-event https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

22/06 2018
22/06 2018

dev-patch/while-loop-getrows

dev-patch/while-loop-getrows https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

20/06 2018
20/06 2018
12/06 2018
12/06 2018

dev-implement-new-fuel-sdk

dev-implement-new-fuel-sdk https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

11/03 2018

1.0.1.5

1.0.1.5 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

11/03 2018

dev-hotfix/getResults

dev-hotfix/getResults https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

22/02 2018

1.0.1.4

1.0.1.4 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

06/02 2018

1.0.1.3

1.0.1.3 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

06/02 2018

dev-release/1.0.2

dev-release/1.0.2 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

06/02 2018

1.0.1.2

1.0.1.2 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

25/01 2018

v1.0.1.1

1.0.1.1 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

25/01 2018

dev-develop

dev-develop https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

17/01 2018

1.0.1

1.0.1.0 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

14/12 2017

v1.0.0

1.0.0.0 https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel

30/07 2016

dev-feature/jrodi-changes

dev-feature/jrodi-changes

Ariad customization to The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

ariad-exacttarget-laravel

15/03 2016

dev-feature/asset-upload

dev-feature/asset-upload https://github.com/:vendor/:package_name

The best way to talk to Exact Target with Hypertext PreProcessor

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel exact target digitaladditive exacttargetlaravel