PHPackages                             salesforce-et/fuel-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. salesforce-et/fuel-sdk

ActiveLibrary[API Development](/categories/api)

salesforce-et/fuel-sdk
======================

Salesforce Marketing Cloud Fuel SDK for PHP

015PHP

Since Jun 16Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/asif1093/rtsfa)[ Packagist](https://packagist.org/packages/salesforce-et/fuel-sdk)[ RSS](/packages/salesforce-et-fuel-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

FuelSDK-PHP
===========

[](#fuelsdk-php)

Salesforce Marketing Cloud Fuel SDK for PHP

> 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.

Overview
--------

[](#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.

New Features in Version 1.4.0
-----------------------------

[](#new-features-in-version-140)

In Addition to the OAuth2 feature added as part of Version 1.3.0, We have now added the support to authenticate Public/Web Apps using OAuth2.

- Sample Config for OAuth2:

```
    'appsignature' => 'none',
    'clientid' => '',
    'clientsecret' => '',
    'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
    'xmlloc' => '/some/path/to/cache/ExactTargetWSDL.xml',
    'baseAuthUrl' => '',
    'baseSoapUrl' => '',
    'baseUrl' => '',
    'useOAuth2Authentication' => true,
    'applicationType' => 'public|web'
    'redirectURI' => 'REDIRECT_URL_FOR_YOUR_APP'
    'authorizationCode' => 'AUTHORIZATION_CODE_RECEIVED_FROM_AUTHORIZE_UI_CALL'
    'accountId' => ,
    'scope' => ''

```

- Example passing config as a parameter to ET\_Client constructor:

```
  $myclient = new ET_Client(
    true,
    true,
    array(
           'appsignature' => 'none',
           'clientid' => '',
           'clientsecret' => '',
           'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
           'xmlloc' => '/some/path/to/cache/ExactTargetWSDL.xml',
           'baseAuthUrl' => '',
           'baseSoapUrl' => '',
           'baseUrl' => '',
           'useOAuth2Authentication' => true,
           'applicationType' => 'public|web'
           'redirectURI' => 'REDIRECT_URL_FOR_YOUR_APP'
           'authorizationCode' => 'AUTHORIZATION_CODE_RECEIVED_FROM_AUTHORIZE_UI_CALL'
           'accountId' => ,
           'scope' => ''
    )
  );

```

Version 1.3.0
-------------

[](#version-130)

- Added support for OAuth2 authentication - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/integration-considerations.htm)
- To enable OAuth2 authentication, set `'useOAuth2Authentication' => true` in the config.php file or pass it in the `params` argument to the ET\_Client constructor.
- Sample Config for OAuth2:

```
    'appsignature' => 'none',
    'clientid' => '',
    'clientsecret' => '',
    'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
    'xmlloc' => '/some/path/to/cache/ExactTargetWSDL.xml',
    'baseAuthUrl' => '',
    'baseSoapUrl' => '',
    'baseUrl' => '',
    'useOAuth2Authentication' => true,
    'accountId' => ,
    'scope' => ''

```

- Example passing config as a parameter to ET\_Client constructor:

```
  $myclient = new ET_Client(
    true,
    true,
    array(
        'appsignature' => 'none',
        'clientid' => '',
        'clientsecret' => '',
        'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
        'xmlloc' => '/some/path/to/cache/ExactTargetWSDL.xml',
        'baseAuthUrl' => '',
        'baseSoapUrl' => '',
        'baseUrl' => '',
        'useOAuth2Authentication' => true,
        'accountId' => '',
        'scope' => ''
    )
  );

```

Version 1.2.0
-------------

[](#version-120)

- Added support for your tenant’s endpoints - [More Details](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/your-subdomain-tenant-specific-endpoints.htm)

Requirements
------------

[](#requirements)

PHP Version &gt;=5.6.24

Extensions:

- openssl
- SOAP
- curl

API Documentation
-----------------

[](#api-documentation)

Installation
------------

[](#installation)

### Manual 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.

### Composer

[](#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.

The following code is an example of a minimal composer.json file:

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

Getting Started
---------------

[](#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.

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.

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.

You can define your own REST, SOAP and Authentication base urls both in the config file and the ET\_Client constructor params argument. If the REST &amp; SOAP base urls are not defined, it should default to `https://www.exacttargetapis.com` and `https://auth.exacttargetapis.com`.

Example Request
---------------

[](#example-request)

All ExactTarget objects exposed through the Fuel SDK begin with be prefixed with "ET\_". Start by working with the ET\_List object:

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

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

> require \_\_DIR\_\_ . '/../vendor/autoload.php';

Add use statement to reference the FuelSdk namespace:

> use FuelSdk\\ET\_Client;
> use FuelSdk\\ET\_List;

Next, create an instance of the ET\_Client class:

> $myclient = new ET\_Client();

Create an instance of the object type we want to work with:

> $getList = new ET\_List();

Associate the ET\_Client to the object using the authStub property:

> $getList-&gt;authStub = $myclient;

Utilize one of the ET\_List methods:

> $getResponse = $getList-&gt;get();

Print out the results for viewing

> print\_r($getResponse);

**Example Output:**

```
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
----------------

[](#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.

The ET\_Client class accepts multiple parameters

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

> $myclient = new ET\_Client(true);

**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.

> $myclient = new ET\_Client(true,true);

**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.

Example passing JWT:

> $myclient = new ET\_Client(true, array("jwt"=&gt;"JWT Values goes here"));

Example passing ClientID/ClientSecret:

> $myclient = new ET\_Client(true, array("clientid" =&gt; "3bjbc3mg4nbk64z5kzczf89n", "clientsecret"=&gt;"ssnGAPvZg6kmm775KPj2Q4Cs"));

Example passing base urls for REST, Authentication and SOAP:

> $myclient = new ET\_Client(true, array("baseUrl" =&gt; "", "baseAuthUrl" =&gt; "", "baseSoapUrl" =&gt; ""));

Responses
---------

[](#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.

- 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):

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

Samples
-------

[](#samples)

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

Sample List:

- [BounceEvent](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-bounceevent.php)
- [Campaign](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-campaign.php)
- [ClickEvent](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-clickevent.php)
- [ContentArea](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-contentarea.php)
- [DataExtension](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-dataextension.php)
- [DataExtractActivity](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-data-extract-activity.php)
- [Email](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-email.php)
- [Folder](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-folder.php)
- [List](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-list.php)
- [List &gt; Subscriber](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-list.subscriber.php)
- [OpenEvent](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-openevent.php)
- [ResultMessage](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-resultmessage.php)
- [SentEvent](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-sentevent.php)
- [Subscriber](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-subscriber.php)
- [TriggeredSend](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-triggeredsend.php)
- [TriggeredSendSummary](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-triggeredsendsummary.php)
- [UnsubEvent](https://github.com/ExactTarget/FuelSDK-PHP/blob/master/objsamples/sample-unsubevent.php)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance40

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/168ff42e1cd20d16d2bd8842df4c98ff2d0bb722bf608479d5091ca1e44ea4ab?d=identicon)[asif2476](/maintainers/asif2476)

---

Top Contributors

[![asif1093](https://avatars.githubusercontent.com/u/156994192?v=4)](https://github.com/asif1093 "asif1093 (6 commits)")

### Embed Badge

![Health badge](/badges/salesforce-et-fuel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/salesforce-et-fuel-sdk/health.svg)](https://phpackages.com/packages/salesforce-et-fuel-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
