PHPackages                             salesforce-mc/marketing-cloud-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-mc/marketing-cloud-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

salesforce-mc/marketing-cloud-sdk
=================================

The Salesforce Marketing Cloud PHP SDK

1.0.0(6y ago)2314[1 issues](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/issues)[3 PRs](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/pulls)BSD-3-ClausePHPPHP &gt;=7.3

Since Nov 29Pushed 3y agoCompare

[ Source](https://github.com/salesforce-marketingcloud/mcsdk-automation-php)[ Packagist](https://packagist.org/packages/salesforce-mc/marketing-cloud-sdk)[ Docs](https://github.com/salesforce-marketingcloud/mcsdk-automation-php)[ RSS](/packages/salesforce-mc-marketing-cloud-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (6)Used By (0)

Salesforce Marketing Cloud - Autogenerated SDK
==============================================

[](#salesforce-marketing-cloud---autogenerated-sdk)

Overview
--------

[](#overview)

The Salesforce Marketing Cloud PHP SDK enables developers to easily access the Salesforce Marketing Cloud.

- This is an upgraded version of the existing community supported [Fuel-PHP](https://github.com/salesforce-marketingcloud/FuelSDK-PHP) SDK
- Unlike the [Fuel-PHP](https://github.com/salesforce-marketingcloud/FuelSDK-PHP), this SDK is auto generated using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)

Supported Features
------------------

[](#supported-features)

- [Transactional Messaging](https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/transactional-messaging-api.htm)

Environment Requirements
------------------------

[](#environment-requirements)

- PHP 7.3 and later

Download
--------

[](#download)

To consume this SDK, add the [Salesforce Marketing Cloud SDK](https://packagist.org/packages/salesforce-mc/marketing-cloud-sdk) to your project using the following command:

`composer require salesforce-mc/marketing-cloud-sdk`

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

[](#getting-started)

### Usage scenarios

[](#usage-scenarios)

#### 1.Basic usage

[](#1basic-usage)

Please *note* that the configuration in this scenario is taken from the environment variables.

```

$client = new SalesForce\MarketingCloud\Api\Client();
$assetApi = $client->getAssetApi();

$asset = new SalesForce\MarketingCloud\Model\Asset();

try {
    $result = $assetApi->createAsset($asset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->createAsset: ', $e->getMessage(), PHP_EOL;
}

```

*Environment variables:*

- SFMC\_ACCOUNT\_ID
- SFMC\_AUTH\_BASE\_URL (Authentication TSE)
- SFMC\_CLIENT\_ID
- SFMC\_CLIENT\_SECRET
- SFMC\_COUNTRY\_CODE (eg: US)
- SFMC\_KEYWORD (SMS keyword)
- SFMC\_SHORT\_CODE (SMS short code)

#### 2.Setting the configuration from code using the configuration builder

[](#2setting-the-configuration-from-code-using-the-configuration-builder)

```
use Symfony\Component\DependencyInjection\ContainerBuilder;

$client = new SalesForce\MarketingCloud\Api\Client(null, null, false);

$config = $client->getConfig();
$config->setAccountId('YOUR_ACCOUNT_ID')
    ->setClientId('YOUR_CLIENT_ID')
    ->setClientSecret('YOUR_CLIENT_SECRET')
    ->setAuthBaseUrl('YOUR_AUTH_TSE')
    ->setAccessTokenUrl('YOUR_AUTH_TSE')
    ->setResourceOwnerDetailsUrl('');

$assetApi = $client->getAssetApi();
$asset = new SalesForce\MarketingCloud\Model\Asset();

try {
    $result = $assetApi->createAsset($asset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetApi->createAsset: ', $e->getMessage(), PHP_EOL;
}

```

To find more information on how to consume the SDK, Refer to the [Regression tests](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/tree/master/src/TestHelper/Decorator) or the [Code Samples](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/tree/master/samples)

### Note

[](#note)

- Most of the code in this repo is auto generated from the [mcsdk-automation-framework-core](https://github.com/salesforce-marketingcloud/mcsdk-automation-framework-core) and the [mcsdk-automation-framework-php](https://github.com/salesforce-marketingcloud/mcsdk-automation-framework-php) repos. Other features like authentication flow, caching are directly implemented in this repo.
- If any change is needed in the auto generated code, it has to come from the [mcsdk-automation-framework-core](https://github.com/salesforce-marketingcloud/mcsdk-automation-framework-core) or the [mcsdk-automation-framework-php](https://github.com/salesforce-marketingcloud/mcsdk-automation-framework-php) repos.
- If any change is needed in the auth flow or caching, it should be done in this repo.

Contact us
----------

[](#contact-us)

- Request a [new feature](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc), add a question or report a bug on GitHub.
- Vote for [Popular Feature Requests](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) by making relevant comments and add your reaction. Use a reaction in place of a "+1" comment:
- 👍 - upvote
- 👎 - downvote

License
-------

[](#license)

By contributing your code, you agree to license your contribution under the terms of the [BSD 3-Clause License](https://github.com/salesforce-marketingcloud/mcsdk-automation-php/blob/master/license.md).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2355d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b103e39fd923db30e5733a7dd594f046617b7ca84cb9b5cac619c4fe5758b5a1?d=identicon)[mcsdkadmin](/maintainers/mcsdkadmin)

---

Top Contributors

[![sfdrogojan](https://avatars.githubusercontent.com/u/42441166?v=4)](https://github.com/sfdrogojan "sfdrogojan (8 commits)")[![svc-scm](https://avatars.githubusercontent.com/u/48930134?v=4)](https://github.com/svc-scm "svc-scm (1 commits)")

---

Tags

phpapisdkswagger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/salesforce-mc-marketing-cloud-sdk/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[clever/clever-php

231.6k](/packages/clever-clever-php)

PHPackages © 2026

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