ausloans/hubspot

HubSpot PHP API 客户端(haPiHP 包装器)

v1.0.13 2022-11-29 12:31 UTC

README

haPiHP 包装器

Latest Stable Version Total Downloads Scrutinizer Code Quality License

如果您想使用新的COS或v2端点,我正在编写一个全新的API客户端:https://github.com/fungku/hubspot-php

V2 创建或更新

一些V2功能已回滚到现有代码库中。

Ausloan开发者已在Laravel 6/7/8下进行测试。

29/11/2022

弃用:?hapi= 查询参数 此库已更新以接受私有应用程序密钥,因为HubSpot API密钥自2022年11月30日起已弃用。从现在开始使用授权头代替 ?hapi=

设置

运行 composer require ausloans/hubspot

然后,在 config/app.php 下的 'Providers' 中添加以下内容

Fungku\HubSpot\HubSpotServiceProvider::class,

示例

$hapikey = "demo";

$hubspot = new Fungku\HubSpot($hapikey);

// get 5 contacts' firstnames, offset by 50
$contacts = $hubspot->contacts()->get_all_contacts(array(
    'count' => 5, // defaults to 20
    'property' => 'firstname', // only get the specified properties
    'vidOffset' => '50' // contact offset used for paging
));

注意: 如果在实例化时未包含 HUBSPOT_APIKEY 环境变量,Hubspot 类会检查该环境变量。

haPiHP

概述

HubSpot API的PHP客户端。此客户端的文档:https://github.com/HubSpot/haPiHP/wiki/haPiHP

通用API参考文档:http://developers.hubspot.com/docs

贡献者