Download the PHP package eventfarm/marketo-client without Composer
On this page you can find all versions of the php package eventfarm/marketo-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eventfarm/marketo-client
More information about eventfarm/marketo-client
Files in eventfarm/marketo-client
Package marketo-client
Short Description A PHP client for the Marketo REST API.
License MIT
Informations about the package marketo-client
marketo-client
This package provides an interface for interacting with the Marketo REST API.
Installation
Or add the following lines to your composer.json
file:
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 for sending HTTP requests
- We've chosen to use The PHP League's Oauth Client and my Marketo provider for Marketo authentication and token refresh.
Guzzle REST Client
Our REST client implements the PSR-7 HTTP message interface.
You can either use the provided RestClientInterface.
KristenlkMarketoProvider
Our default Marketo provider is my Marketo Provider library.
You can either use the provided MarketoProviderInterface.
Example Client Implementation
Usage
Campaigns
Get Campaigns
Docs Returns a list of campaign records. Refer to the docs for the full list of options.
public function getCampaigns(array $options = array())
Trigger Campaign
Docs Passes a set of leads to a trigger campaign to run through the campaign's flow. Refer to the docs for the full list of options.
- A
campaignId
and an array of options that includes aninput
key (mapped to an array that contains arrays of lead data) must be passed totriggerCampaign()
.
public function triggerCampaign(int $campaignId, array $options)
Lead Fields
Get Lead Fields
Docs Returns metadata about lead objects in the target instance, including a list of all fields available for interaction via the APIs.
public function getLeadFields(array $options = array())
Leads
Create or Update Leads
Docs Syncs a list of leads to the target instance. Refer to the docs for the full list of options.
- An array of options that includes an
input
key (mapped to an array that contains arrays of lead data) must be passed tocreateOrUpdateLeads()
.
public function createOrUpdateLeads(array $options)
By default, Marketo sets the type of sync operation (action
) to createOrUpdate
and the lookupField
to email
. If using those defaults:
- Email is not required; if an email is not included in a lead array, Marketo will create a lead without an email.
- When an email is included, Marketo will search for existing leads with that email. If one is found, Marketo will update the found lead with the data sent; if one is not found, Marketo will create a new lead with the data sent.
Update Leads' Program Status
Docs Changes the program status of a list of leads in a target program. Refer to the docs for the full list of options.
- A
programId
and an array of options that includes aninput
key (mapped to an array that contains arrays of lead data) and astatus
key (mapped to a program status) must be passed toupdateLeadsProgramStatus()
.
public function updateLeadsProgramStatus(int $programId, array $options)
Get Leads by Program
Docs Retrieves a list of leads that are members of the designated program. Refer to the docs for the full list of options.
- A
programId
must be passed togetLeadsByProgram()
.
public function getLeadsByProgram(int $programId, array $options = array())
Lead Partitions
Get Lead Partitions
Docs Returns a list of available partitions in the target instance. Refer to the docs for the full list of options.
public function getPartitions(array $options = array())
Programs
Get Programs
Docs Retrieves the list of accessible programs from the target instance. Refer to the docs for the full list of options.
public function getPrograms(array $options = array())
Statuses
Get Statuses
Docs Retrieves channels based on the provided name. Refer to the docs for the full list of options.
- A
programChannel
must be passed togetStatuses()
.
public function getStatuses(string $programChannel, array $options = array())
All versions of marketo-client with dependencies
psr/http-message Version ^1.0
guzzlehttp/guzzle Version ~6.0|~5.0|~4.0
kristenlk/oauth2-marketo Version 1.5