2017 © Pedro Peláez
 

library php-fuel-sdk-fork

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

image

digitaladditive/php-fuel-sdk-fork

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  • Wednesday, May 2, 2018
  • by patrickisgreat
  • Repository
  • 1 Watchers
  • 0 Stars
  • 85 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 9 Versions
  • 204 % Grown

The README.md

FuelSDK-PHP

Salesforce Marketing Cloud Fuel SDK for PHP, (*1)

Salesforce Marketing Cloud Fuel SDK for PHP is free to use but are not official Salesforce Marketing Cloud products and should be considered community projects. This SDK is not officially tested or documented. For help on any Salesforce Marketing Cloud Fuel SDK for PHP, please consult the Salesforce message boards or the issues section of this repository. Salesforce Marketing Cloud support is not available for this SDK., (*2)

Overview

The Fuel SDK for PHP provides easy access to Salesforce Marketic Cloud's Fuel API Family services, including a collection of REST and SOAP API. These APIs provide access to Salesforce Marketing Cloud (previously called ExactTarget) functionality via common collection types such as array/hash., (*3)

New Features in Version 1.1.0

  • namespace : namespace is introduced., (*4)

  • newly supported objects:, (*5)

    • Result Message
    • Data Extract
    • Triggered Send Summary
  • composer autoload issue fix, (*6)

Requirements

PHP Version >=5.6.24, (*7)

Extensions: - openssl - SOAP - curl, (*8)

API Documentation

http://salesforce-marketingcloud.github.io/FuelSDK-PHP/index.html, (*9)

Installation

Manual Installation

After downloading the project, rename the config.php.template file to config.php. Most importantly, you also need to download all dependencies manually and include accordingly. That's why we highly encourage to get it from composer., (*10)

Composer

Add a dependency to composer require salesforce-mc/fuel-sdk-php to the require section of your project's composer.json configuration file, and update your application., (*11)

The following code is an example of a minimal composer.json file:, (*12)

{
    "require": {
        "salesforce-mc/fuel-sdk-php": "1.1.0"
    }
}

Getting Started

Edit config.php so you can input the ClientID and ClientSecret values provided when you registered your application. If you are building a HubExchange application for the Interactive Marketing Hub then, you must also provide the Application Signature (appsignature). Only change the value for the defaultwsdl configuration item if instructed by ExactTarget., (*13)

See the ET_Client section below for details on how to specify these values at the time the ET_Client object is instantiated if you would prefer to store the ClientID and ClientSecret values in a database or other configuration storage mechanism., (*14)

If you have not registered your application or you need to lookup your Application Key or Application Signature values, please go to Salesforce Marketing Cloud App Center., (*15)

Example Request

All ExactTarget objects exposed through the Fuel SDK begin with be prefixed with "ET_". Start by working with the ET_List object:, (*16)

Get the config.php.template file (under vendor/salesforce-mc/ using composer), rename it to config.php and update clientId & clientSecret.
Most importantly, put it in your project's root directory where composer.json file exists., (*17)

Add composer's auto generated autoload.php file, change the path according to your directory structure:, (*18)

require __DIR__ . '/../vendor/autoload.php';, (*19)

Add use statement to reference the FuelSdk namespace:, (*20)

use FuelSdk\ET_Client;
use FuelSdk\ET_List; Next, create an instance of the ET_Client class: $myclient = new ET_Client();, (*21)

Create an instance of the object type we want to work with:, (*22)

$getList = new ET_List();, (*23)

Associate the ET_Client to the object using the authStub property:, (*24)

$getList->authStub = $myclient;, (*25)

Utilize one of the ET_List methods:, (*26)

$getResponse = $getList->get();, (*27)

Print out the results for viewing, (*28)

print_r($getResponse);, (*29)

Example Output:, (*30)

ET_Get Object
(
    [status] => 1
    [code] => 200
    [message] =>
    [results] => Array
        (
            [0] => stdClass Object
                (
                    [Client] => stdClass Object
                        (
                            [ID] => 1000001
                            [PartnerClientKey] => 
                        )

                    [PartnerKey] =>
                    [CreatedDate] => 2009-06-12T14:42:06.1
                    [ModifiedDate] => 2011-08-17T14:50:30.697
                    [ID] => 1718921
                    [ObjectID] => f41c7d1b-8957-de11-92ee-001cc494ae9e
                    [CustomerKey] => All Subscribers - 578623
                    [ListName] => All Subscribers
                    [Category] => 578623
                    [Type] => Private
                    [Description] => Contains all subscribers
                    [ListClassification] => ExactTargetList
                )

        )

    [request_id] => 5d56a37e-4b13-4f0a-aa13-2e108e60a990
    [moreResults] => 
)

ET_Client Class

The ET_Client class takes care of many of the required steps when accessing ExactTarget's API, including retrieving appropriate access tokens, handling token state for managing refresh, and determining the appropriate endpoints for API requests. In order to leverage the advantages this class provides, use a single instance of this class for an entire session. Do not instantiate a new ET_Client object for each request made., (*31)

The ET_Client class accepts multiple parameters, (*32)

Refresh WSDL - If set to true, it will automatically download a local copy of the WSDL whenever an update is found., (*33)

$myclient = new ET_Client(true);, (*34)

Debug - If set to true, all API requests that the Fuel SDK is making behind the scenes will be logged to PHP's error log. This option should only be set to true in order to troubleshoot during the development process and should never be used in a production scenario., (*35)

$myclient = new ET_Client(true,true);, (*36)

Parameters - Allows for passing authentication information for use with SSO with a JWT or for passing ClientID/ClientSecret if you would prefer to not use the config file option., (*37)

Example passing JWT:, (*38)

$myclient = new ET_Client(true, array("jwt"=>"JWT Values goes here"));, (*39)

Example passing ClientID/ClientSecret:, (*40)

$myclient = new ET_Client(true, array("clientid" => "3bjbc3mg4nbk64z5kzczf89n", "clientsecret"=>"ssnGAPvZg6kmm775KPj2Q4Cs"));, (*41)

Responses

All methods on Fuel SDK objects return a generic object that follows the same structure, regardless of the type of call. This object contains a common set of properties used to display details about the request., (*42)

  • status: Boolean value that indicates if the call was successful
  • code: HTTP Error Code (will always be 200 for SOAP requests)
  • message: Text values containing more details in the event of an error
  • results: Collection containing the details unique to the method called.

Get Methods also return an addition value to indicate if more information is available (that information can be retrieved using the getMoreResults method):, (*43)

  • moreResults - Boolean value that indicates on Get requests if more data is available.

Samples

Find more sample files that illustrate using all of the available functions for ExactTarget objects exposed through the API in the objsamples directory., (*44)

Sample List:, (*45)

The Versions

02/05 2018

dev-master

9999999-dev https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

02/05 2018

1.2.0

1.2.0.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

02/05 2018

dev-develop

dev-develop https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

v1.0.1

1.0.1.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

v1.1

1.1.0.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

0.1.2

0.1.2.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

v1.0

1.0.0.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

0.1.1

0.1.1.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk

01/05 2018

0.1

0.1.0.0 https://developer.salesforce.com/docs/atlas.en-us.mc-sdks.meta/mc-sdks/index-sdk.htm

Fork of the Salesforce Marketing Cloud Fuel SDK for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk sdk salesforce marketing cloud exacttarget fuel sdk fuel-sdk