1. Go to this page and download the library: Download hgg/pardot 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/ */
hgg / pardot example snippets
use HGG\Pardot\Connector;
use HGG\Pardot\Exception\PardotException;
$connectorParameters = array(
'email' => 'The email address of the user account',
'user-key' => 'The user key of the user account (in My Settings)',
'password' => 'The account password',
'format' => 'json',
'output' => 'full'
);
$connector = new Connector($connectorParameters);
$queryParameters = array(
'created_after' => 'yesterday',
'limit' => 200,
'offset' => 0
);
$response = $connector->post('prospect', 'query', $queryParameters);
// Obtain the total record count of the query from the connector
// If this is larger than the limit make requests (increasing the offset each
// time) until all records have been fetched
$count = $connector->getResultCount();
use HGG\Pardot\Exception\ExceptionInterface;
try {
// Pardot library code
} catch (ExceptionInterface $e) {
// Handle it here
}