generationtux / marketo-rest-api-client
Marketo Rest Api Client
Installs: 253 582
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 19
Forks: 1
Open Issues: 0
Requires
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- mockery/mockery: ^0.9
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-19 23:03:48 UTC
README
Installation
composer require generationtux/marketo-rest-api-client
Usage
Instantiation
$client = new Client([ 'api_url' => 'foo.bar/api', 'client_id' => 'foobarid', 'client_secret' => 'foobarsecret' ]);
Creating a lead
Click here to find all valid fields for leads.
$client->leads()->create([ [ 'firstName' => 'Joe', 'lastName' => 'Bar', 'email' => 'foolead1@bar.com' ], [ 'firstName' => 'Sally', 'lastName' => 'Bar', 'email' => 'foolead2@bar.com' ] ]);
Getting a lead
$lead = $client->leads()->show('fooemail@bar.com'); // outputs an object with all valid information on the lead $lead->email; // outputs 'fooemail@bar.com'
Triggering a campaign
To trigger a campaign, provide the campaign id, the email of the lead that will receive the campaign email, and an array of tokens (variables) for the template email belonging to the campaign
$client-campaign() ->trigger(1234, 'foobar@email.com', [ '{{my.name}}' => 'Foo' ] );