PHP code example of eyefi / marketo

1. Go to this page and download the library: Download eyefi/marketo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eyefi / marketo example snippets

 php

use Marketo\Marketo;
$marketo_client = new Marketo($_ENV['MARKETO_USER_ID'], $_ENV['MARKETO_ENCRYPTION_KEY'], $_ENV['MARKETO_SOAP_HOST']);
 php

$marketo_client->get_lead_by('email', '[email protected]');
 php

$marketo_client->sync_lead(array('Email' => '[email protected]'));
 php

$marketo_client->sync_lead(array('Unsubscribed' => FALSE), '[email protected]', $_COOKIE['_mkto_trk']);
 php

$client->add_to_campaign(321, array('idnum' => '123456'));
 php

$leads = array(
   array('idnum' => '123456'),
   array('sfdcleadid' => '001d000000FXkBt')
);
	
$client->add_to_campaign(321, $leads);
 php

$marketo_client->get_campaigns();