afischoff / php-pardot-api
An API wrapper for the Pardot (a salesforce.com company) API.
dev-master
2013-11-22 19:17 UTC
This package is not auto-updated.
Last update: 2024-11-04 14:34:49 UTC
README
PHP wrapper for the Pardot RESTful API
Requirements
- PHP 5.3.*
- cURL library installed
- Install directory should be writable (not required, but strongly encouraged)
Configuration
- Set the email, password, and user_key values in the pardot_config.php file
- Set the debug mode and logging settings in the pardot_config.php file (optional)
Usage
- Set the namespace:
use \Pardot\API as API;
- Make requests using the 3 main request functions:
doOperationById($object, $operation, $id = null, $parameters = null)
doOperationByField($object, $operation, $field = null, $fieldValue = null, $parameters = null)
queryObject($object, $parameters = null)
The $object
and $operation
values are the constants referenced at the top of the class file.
<?php
// namespace config
use \Pardot\API as API;
// get all prospects updated within the last 2 hours
$prospects = API::Instance()->queryObject(API::OBJ_PROSPECT, array('updated_after' => '2 hours ago'));
var_dump($prospects);
See the example.php file for complete usage examples.