PHPackages                             lsubirana/marketo-rest-client - 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. lsubirana/marketo-rest-client

ActiveLibrary

lsubirana/marketo-rest-client
=============================

A PHP client for the Marketo REST API. Forked from https://github.com/vpmv/marketo-client by Kristen Kehlenbeck &amp; Valentijn Verhallen.

01PHP

Since Mar 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lsubi/LSMarketoClient)[ Packagist](https://packagist.org/packages/lsubirana/marketo-rest-client)[ RSS](/packages/lsubirana-marketo-rest-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Marketo Client
--------------

[](#marketo-client)

[![Travis](https://camo.githubusercontent.com/348fd28e3ceb064905f8970be8c0223fc15a1b41857886083cd7fa00b2a05909/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6574697475732f6d61726b65746f2d636c69656e742e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://travis-ci.org/netitus/marketo-client)[![Downloads](https://camo.githubusercontent.com/3aa0ca4d0f741f7bc777916b33fd6f18b0f6fd11d5d2ccda01badafa43908586/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6574697475732f6d61726b65746f2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/netitus/marketo-client)[![Packagist](https://camo.githubusercontent.com/3ed583f0ec873dceea186ec715e094c401522d15603194886c796ac25789cfd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6574697475732f6d61726b65746f2d636c69656e742e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://packagist.org/packages/netitus/marketo-client)

This package provides an interface for interacting with the Marketo REST API.

The code is a revamped fork of [eventfarm/marketo-client](github.com/eventfarm/marketo-client). The internal architecture has been simplified, performance improved and helper functions added to aid integration into your consumer application.

Installation
============

[](#installation)

```
$ composer require netitus/marketo-client

```

Or add the following lines to your `composer.json` file:

```
{
    "require": {
        "netitus/marketo-client": "dev-master"
    }
}
```

```
$ composer install
```

Implementation details
======================

[](#implementation-details)

Project Defaults
----------------

[](#project-defaults)

In order to get you up and running as easily as possible, we provide default implementations of a REST client and Marketo provider to use in combination with this package.

- We've chosen to use [Guzzle](https://github.com/guzzle/guzzle) for sending HTTP requests
- We've chosen to use [The PHP League's Oauth Client](https://github.com/thephpleague/oauth2-client) for Marketo authentication and token refresh.

You can **extend the client** to implement your own interface to cache the access token, using the construct argument TokenRefreshCallback.

Guzzle REST Client
------------------

[](#guzzle-rest-client)

Our REST client implements the PSR-7 HTTP message interface.

You can either use the provided [GuzzleRestClient](./src/RestClient/GuzzleRestClient.php) or have your own that implements our [RestClientInterface](./src/RestClient/RestClientInterface.php).

MarketoProvider
---------------

[](#marketoprovider)

Our default Marketo OAuth2 provider is the [Marketo Provider](https://github.com/kristenlk/oauth2-marketo) library.

You can either use the provided [MarketoProvider](./src/Oauth/MarketoProvider.php) or use your own that implements our [MarketoProviderInterface](./src/Oauth/MarketoProviderInterface.php).

Example Client Implementation
-----------------------------

[](#example-client-implementation)

```
