定制 cyber-duck/pardot-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cyber-duck/pardot-api

Composer 安装命令:

composer require cyber-duck/pardot-api

包简介

PHP package to interact with the Pardot API

关键字:

README 文档

README

PHP package to interact with the Pardot API

Latest Stable Version Latest Unstable Version Total Downloads License

Author: Andrew Mc Cormack

Pardot API PHP Library

A library to integrate with the Pardot API through PHP objects

This library simplifies the process of authentication and querying the Pardot API and provides access to all of the v4 API features.

Latest Version 2.0.0 supports Salesforce SSO authentication.

Setup

To initalise the Pardot API object pass your user email, password, client id, client secret and business unit id credentials. Any subsequent request to fetch data from the API will automatically perform the authentication actions before trying to fetch data.

use CyberDuck\PardotApi\PardotApi;

$pardot = new PardotApi(
    'EMAIL',
    'PASSWORD',
    'CLIENT_ID',
    'CLIENT_SECRET',
    'BUSINESS_UNIT_ID',
);

Querying the API

You can call the query method on an any pardot object passing the object, operator, and data array (optional)

$result = $pardot->request('campaign', 'read/id/1');

$result = $pardot->request('campaign', 'query', ['created_after' => 'today']);

Object Methods

The PardotApi instance has functions which correspond to the object types in Pardot to simplify calls to the API. When calling one of these functions a query object is returned (->campaigns() returns a CampaignsQuery object). These returned objects in turn have functions corresponding to different object actions such as query, create, update, insert, delete etc. The full list of objects available are as follows:

Account methods

$pardot->account()->read(); // retrieves current account information

Campaign methods

$pardot->campaign()->query([...]); // queries and returns a filtered list
$pardot->campaign()->create([...]); // creates an object using passed array data
$pardot->campaign()->read(1); // queries an object by ID
$pardot->campaign()->update(1, [...]); // updates an object by ID using passed array data 

Custom Fields methods

$pardot->customField()->query([...]); // queries and returns a filtered list
$pardot->customField()->create([...]); // creates an object using passed array data
$pardot->customField()->read(1); // queries an object by ID
$pardot->customField()->update(1, [...]); // updates an object by ID using passed array data 
$pardot->customField()->delete(1); // deletes an object by ID

Custom Redirects methods

$pardot->customRedirect()->query([...]); // queries and returns a filtered list
$pardot->customRedirect()->read(1); // queries an object by ID

Dynamic Content methods

$pardot->dynamicContent()->query([...]); // queries and returns a filtered list
$pardot->dynamicContent()->read(1); // queries an object by ID

Email Clicks methods

$pardot->emailClick()->query([...]); // queries and returns a filtered list

Email methods

$pardot->email()->read(1); // queries an object by ID
$pardot->email()->stats(1); // Returns the statistical data for the list email 
$pardot->email()->sendToID(1, [...]); // Sends a 1 to 1 email to an ID using an array of email config / data
$pardot->email()->sendToEmail('name@example.com', [...]); // Sends a 1 to 1 email to a email address an array of email config / data
$pardot->email()->send([...]); // send an email to a list of IDs

Email Templates methods

$pardot->emailTemplate()->listOneToOne(); // Returns a list of email templates used in 1 to 1 emails

Forms methods

$pardot->form()->query([...]); // queries and returns a filtered list
$pardot->form()->read(1); // queries an object by ID

Lifecycle Histories methods

$pardot->lifecycleHistory()->query([...]); // queries and returns a filtered list
$pardot->lifecycleHistory()->read(1); // queries an object by ID

Lifecycle Stages methods

$pardot->lifecycleStage()->query([...]); // queries and returns a filtered list

List Memberships methods

// @todo

Lists methods

// @todo

Opportunities methods

// @todo

Prospect Accounts methods

// @todo

Prospects methods

// @todo

Tag Objects methods

$pardot->tagObject()->query([...]); // queries and returns a filtered list
$pardot->tagObject()->read(1); // queries an object by ID

Tags methods

$pardot->tag()->query([...]); // queries and returns a filtered list
$pardot->tag()->read(1); // queries an object by ID

Users methods

$pardot->user()->query([...]); // queries and returns a filtered list
$pardot->user()->read(1); // queries an object by ID
$pardot->user()->readByEmail('name@example.com'); // queries an object by email

Visitor Activities methods

// @todo

Visitors methods

$pardot->visitor()->query([...]); // queries and returns a filtered list
$pardot->visitor()->read(1); // queries an object by ID
$pardot->visitor()->assign(1,2); // Assigns or reassigns the visitor by ID to a prospect ID.

Visits methods

$pardot->visit()->query([...]); // queries and returns a filtered list
$pardot->visit()->read(1); // queries an object by ID

Debugging

Error messages can be enabled by turning debugging on. Requests to the Pardot API will fail silently by default so as to prevent fatal application errors. Extra response checking should be conducted when implementing this library as most methods will return null when there is an issue with the API query.

$pardot->setDebug(true);

Output Type

You can change the output type to full, simple, mobile, or bulk. Defaults to full.

$pardot->setOuput('full');

cyber-duck/pardot-api 适用场景与选型建议

cyber-duck/pardot-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.67k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2019 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「pardot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 cyber-duck/pardot-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cyber-duck/pardot-api 我们能提供哪些服务?
定制开发 / 二次开发

基于 cyber-duck/pardot-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 7
  • Forks: 24
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-03-06