afischoff / php-pardot-api
Pardot API(Salesforce.com公司)的API包装器。
dev-master
2013-11-22 19:17 UTC
This package is not auto-updated.
Last update: 2024-09-23 14:03:07 UTC
README
为Pardot RESTful API编写的PHP包装器
需求
- PHP 5.3.*
- 已安装cURL库
- 安装目录应为可写(非必需,但强烈推荐)
配置
- 在pardot_config.php文件中设置电子邮件、密码和user_key值
- 在pardot_config.php文件中设置调试模式和日志设置(可选)
用法
- 设置命名空间:
use \Pardot\API as API;
- 使用3个主要请求函数进行请求
doOperationById($object, $operation, $id = null, $parameters = null)
doOperationByField($object, $operation, $field = null, $fieldValue = null, $parameters = null)
queryObject($object, $parameters = null)
$object
和 $operation
的值是类文件顶部引用的常量。
<?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);
查看example.php文件以获取完整的用法示例。