I recently started programming an integration between our billing software (WHMCS) and Hubspot, when a new client is created in our billing software a hook script triggers which does three things, it first creates a company via the Api and stores the comanyid, this is successful and displays correctly in the frontend.
It then creates a contact with all the client information and stores the vid number. This works, however, the hubspot interface doesn’t always show the contact, it seems like it fails but if I try to create the same user again I get an error and linked to the contact in question, why this contact isn’t displayed in the frontend interface I dont know.
The third thing that the script does is create an association using the companyId and vid to link the two. This also seems successful based on the curl response but again the association doesn’t show in the frontend interface.
My question I suppose is: Are the frontend views cached in some way, can I invalidate that cache, are these issues I can work around in some way? Below is the code I’m using for the association, I’ve confirmed all varibles are populated correctly:
//PUT request curl for associations
$assArray = array(
'fromObjectId' => $companyID,
'toObjectId' => $contactID,
'category' => 'HUBSPOT_DEFINED',
'definitionId' => '2'
);
$ch = curl_init($endpointAss);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($assArray));
$response = curl_exec($ch);
//logActivity($contactID, 0);
//logActivity($companyID, 0);
I’m stumpped on this one as my code seems to be working just fine but the results from the frontend of the test account are inconsistent, as such I cant trust what I’m seeing in there. Any help would be greatly appreciated.