martechboy/marketo-rest-api

Market.com REST API 的 PHP 客户端

v0.0.7 2018-04-09 21:20 UTC

This package is not auto-updated.

Last update: 2024-10-02 19:36:14 UTC


README

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

安装

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

composer require martechboy/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 文件。如果您使用此代码,我们会很高兴听到您的反馈。