coderjerk/hubsnot

Hubspot API v3 Client

Fund package maintenance!
danieldevine

v0.2.1 2023-12-12 12:05 UTC

This package is auto-updated.

Last update: 2024-10-12 14:11:03 UTC


README

PHP client for the Hubspot API v3

Latest Packagist Version Total Downloads

A very simple client because their own one looks unfinished and isn't really usable.

Just solving my own use case for now, which is simply to grab a list of available forms, more to come. Don't use in production unless this is all you want to do too.

$credentials = [
    'hubspot_access_token' => $_ENV['HUBSPOT_ACCESS_TOKEN']
];

$hubsnot = new Hubsnot($credentials);

$params = [
    'limit' => 200,
];

$forms = $hubsnot->forms()->getForms($params);

foreach ($forms->results as $form) {
    echo nl2br($form->name . "\r\n");
    echo nl2br($form->id . "\r\n");
}