A new HubSpot API client. The sequel to my perfectly functional wrapper of HubSpot/haPihP. client. However, this includes some of the new COS/v2 endpoints.
Please try it out, and let me know if things are working as expected.
Composer:
"require": {
"fungku/hubspot-php": "~0.9@dev"
}
All following examples assume this step.
Note: The Hubspot class checks for a HUBSPOT_API_KEY
environment variable if you don't include one during instantiation.
$hubspot = Fungku\HubSpot\HubSpotService::make('api-key');
$contact = $hubspot->contacts()->getByEmail("[email protected]");
// Get an array of 10 contacts
// getting only the firstname and lastname properties
// and set the offset to 123456
$collection = $hubspot->contacts()->all([
'count' => 10,
'property' => ['firstname', 'lastname'],
'vidOffset' => 123456,
]);
foreach ($collection['contacts'] as $contact) {
echo $contact['properties']['firstname']['value'];
}
// Info for pagination
echo $collection['has-more'];
echo $collection['vid-offset'];
$vids = [196189, 196188, 196187];
// Get batch of contacts, and limit properties to firstname
$contacts = $hubspot->contacts()->getBatchByIds($vids, ['property' => 'firstname']);
foreach ($contacts as $contact) {
echo $contact['properties']['firstname']['value'];
}
(:ballot_box_with_check: Complete, :wavy_dash: In Progress, :white_medium_small_square: Todo, :black_medium_small_square: Not planned)
If you see something not planned, that you want, make an issue and there's a good chance I will add it.
โ๏ธ Blog (COS) ๐
โ๏ธ Blog Posts (COS) ๐
โ๏ธ Contacts
โ๏ธ Contact Lists
โ๏ธ Contact Properties
โ๏ธ Email ๐
โ๏ธ Email Events ๐
โ๏ธ Files (COS) ๐
โ๏ธ Forms
โ๏ธ Keywords
โ๏ธ Page Publishing (COS) ๐
โ๏ธ Social Media
โ๏ธ Workflows
โพ Blog (CMS)
โพ Companies ๐
โพ Companies Properties ๐
โพ Deals ๐
โพ MarketPlace
โพ Settings