Oct 15, 2021 6:10 PM
I need help. I need basic help.
Here is the deal.
I am running this code below from PHPStorm with the commposer installed an pointed.
I cannot get the local web server to run it, And I get a 500 error when running it on the PHP/IIS Web server where I have WordPress running.
Just running the code in php gets me an error 255.
I have loaded thousands of contacts using the URL version of the API. What requirment am I missing to run the API V3 factory code?
<?php
use HubSpot\Factory;
use HubSpot\Client\Crm\Contacts\ApiException;
$client = Factory::createWithApiKey("YOUR_HUBSPOT_API_KEY"); <REPLACED WITH MY KEY.
try {
$apiResponse = $client->crm()->contacts()->basicApi()->getPage(10, null, null, null, false);
var_dump($apiResponse);
} catch (ApiException $e) {
echo "Exception when calling basic_api->get_page: ", $e->getMessage();
}
Oct 19, 2021 9:25 AM - edited Oct 19, 2021 9:31 AM
You can find the exmple of accessing the
Contact at this web site: https://developers.hubspot.com/docs/api/crm/contacts. See Enpoints.
Oct 19, 2021 8:56 AM
Sure:
See this code taken from V3 API documentation from Hubspot Development:
<?php
use HubSpot\Factory;
use HubSpot\Client\Crm\Contacts\ApiException;
$client = Factory::createWithApiKey("YOUR_HUBSPOT_API_KEY"); <REPLACED WITH MY KEY.
try {
$apiResponse = $client->crm()->contacts()->basicApi()->getPage(10, null, null, null, false);
var_dump($apiResponse);
} catch (ApiException $e) {
echo "Exception when calling basic_api->get_page: ", $e->getMessage();
}
The code runs on the documentation web site for Hubspot and returns my data. I am replicating this on my system now.
I am using PHPStorm, I have installed the package and examples for V3 API and all referances dependents resolve to the proper Factory.php and the Vendors used through composer.
I have compiled the the code in run time in PHPStorm both on the local web server as well as the fully functinoal PHP web server hosted on an IIS server.
It would apper that the V3 API does not allow me to connect OR the hosting PHP server is missing some dependent.
Thanks
Oct 19, 2021 8:29 AM
Hello @Cainley,
Can you please explain a bit more about what you were trying to do and which API you used for this etc so that I can give you a proper solution for this?
Regards,
Oct 18, 2021 10:38 AM
Any chance you could help out here?
Oct 26, 2021 9:07 AM
Is this how you help the community. By allowing fake accounts and comments listed as solutions clearly wrong?