PHPackages                             vpmv/marketo-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. [API Development](/categories/api)
4. /
5. vpmv/marketo-client

ActiveLibrary[API Development](/categories/api)

vpmv/marketo-client
===================

A PHP client for the Marketo REST API.

1.0(4y ago)08MITPHPPHP &gt;=7.4

Since Feb 7Pushed 2y agoCompare

[ Source](https://github.com/vpmv/marketo-client)[ Packagist](https://packagist.org/packages/vpmv/marketo-client)[ RSS](/packages/vpmv-marketo-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

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

[](#marketo-client)

[![Travis](https://camo.githubusercontent.com/441ad0029df0620ae300c720dfcd71ca36d0691bdf647be093388f47fc7efce1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f76706d762f6d61726b65746f2d636c69656e742e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://travis-ci.org/vpmv/marketo-client)[![Downloads](https://camo.githubusercontent.com/69f5e6fb334d9f1f98425074bd6d21500dd0b3a5ccb03a73250b067a3b14bdac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76706d762f6d61726b65746f2d636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vpmv/marketo-client)[![Packagist](https://camo.githubusercontent.com/3d6483bc6dccf53d4b69d33b6dedcc2b55cb1f8f67678749e5ae610b9f80a826/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f76706d762f6d61726b65746f2d636c69656e742e7376673f6d61784167653d323539323030303f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vpmv/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 vpmv/marketo-client

```

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

```
{
    "require": {
        "vpmv/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)

```
