Apr 24, 2017 10:19 AM
I have tried https://github.com/HubSpot/haPiHP library which did not work out for me.
require_once "haPiHP/class.contacts.php"; $HAPIKey = "cbxxxxea-xxxx-xxxx-xxxx-xxxa8axxxx98"; $contacts = new HubSpot_Contacts($HAPIKey); $contacts_recent_batch1 = $contacts->get_recent_contacts(''); echo "<pre>"; print_r($contacts_recent_batch1); echo "</pre>";
Above code returns an empty array.
EDIT: above code works when I have
$HAPIKey = ‘demo’;
Oct 25, 2018 11:36 AM
Thanks a lot @phena109! I got nicely with this library all the contact data (except profile_token and profile_url that return value 0 for me) but can't find any example code to move on with updating contact data by vid or email when it's updated externally.
PS. I'm also trying to sync Hubspot (or something else you suggest - checking also Zoho and some others - haven't picked the one yet) and our external system in the way that we check the contact's last updated date and overwrite the older with newer if the date isn't equal. Only thing I know we can't get via API from HubSot is avatar but that's not an issue if we can send avatar to HubSpot via API (not sure about that yet).
Apr 27, 2017 10:20 PM
I think this is by far a much better PHP library to use the hubspot API. It is up-to-date and very intuitive. It also cover almost every API that hubspot provides.
Jan 10, 2020 5:32 AM
I'm trying to use hubspot-php library but I have some problems. It's all fine when creating a contacts object but then I can not call any function; getting a Http 500
require 'vendor/autoload.php'; use SevenShores\Hubspot\Http\Client; use SevenShores\Hubspot\Resources\Contacts; $client = new Client(['key' => 'demo']); $contacts = new Contacts($client);
$contact = $contacts->getByEmail("firstname.lastname@example.org"); //not working
Can u pls give me an advice?
Apr 28, 2017 11:26 AM
I don’t mean to interfere with how you code your project. But you sound to me not using composer. If you are using composer, you should have no issue with the dependency of Guzzle.
Please follow this link to install composer: https://getcomposer.org/doc/00-intro.md#installation-windows
And then you can install hubspot-php:
There are other settings and adjustments and stuff, but once you get used to using composer, your coding experience should be much better than now.
hope this help
Apr 24, 2017 10:26 AM
@ar-hz I don’t believe that repository is up to date. It was last worked on in October of 2015. Did you choose php for that library or do you have experience coding in php
Apr 24, 2017 10:53 AM
Thanks @pmanca We have a platform based on PHP and I need to integrate Hubspot with it. Therefore, I needed the PHP library. Is there a JS library tho?
If this library is outdated then I guess I just have to write the CURL method and make my own client-library?
Apr 24, 2017 11:03 AM
@ar-hz The best way might be able to make your own CURL methods, and client-library.
I have written a node.js library here which I can help you out with if you choose to go that route. I’d also be more then happy to work with you through PHP. I just can’t speak to that specific php library.