zpearl/marketo-rest-api

Market.com REST API 的 PHP 客户端

0.0.10 2020-11-04 19:46 UTC

This package is auto-updated.

Last update: 2024-09-05 05:56:48 UTC


README

Market.com REST API 的非官方 PHP 客户端:http://developers.marketo.com/documentation/rest/。需要 PHP 5.3.3+。

安装

推荐通过 Composer 安装客户端。只需运行以下命令即可将库添加到您的 composer.json 文件中。

composer require dchesterton/marketo-rest-api

设置

客户端基于 Guzzle 3 构建,并使用工厂方法创建实例。您必须指定 Munchkin ID 或完整 URL。

####对于 Rest Api 访问

use CSD\Marketo\Client;

$client = Client::factory(array(
    'client_id' => 'Marketo client ID',         // required
    'client_secret' => 'Marketo client secret', // required
    'munchkin_id' => '100-AEK-913' // alternatively, you can supply the full URL, e.g. 'url' => 'https://100-AEK-913.mktorest.com'
));

####对于 Bulk Api 访问

use CSD\Marketo\Client;

$client = Client::factory(array(
    'client_id' => 'Marketo client ID',         // required
    'client_secret' => 'Marketo client secret', // required
    'munchkin_id' => '100-AEK-913' // alternatively, you can supply the full URL, e.g. 'url' => 'https://100-AEK-913.mktorest.com'
    'bulk' => true // if uploading leads via file upload (e.g. csv)
));

用法

查看 src/Client.php 的源代码以了解所有可用方法。

许可证

此源代码受 MIT 许可证许可,有关详细信息,请参阅 LICENSE 文件。如果您使用此代码,我们非常愿意听到您的反馈。