APIs & Integrations

asmoradiya
Member

API to fetch property history

SOLVE

Hello,

Does hubspot provides API to fetch history of property? for example I need to get full list of pages that perticular contact has visited, see here - https://www.screencast.com/t/wVqg0yYXS

Can I fetch this via some API?
I am considering to use third party CData hubspot provider to sync my Hubspot contacts to Dynamics (with property history data). Any better solution available in market?

Thanks
Ashish

0 Upvotes
1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API to fetch property history

SOLVE

Welcome, @Louis_Rankin.

This is only possible through the Get all companies endpoint at this time with the query parameter propertiesWithHistory=desired_property in the request URL.

I played around with a few variations on the Get a company endpoint, but unfortunately had no success.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
11 Replies 11
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

API to fetch property history

SOLVE

Welcome, @Louis_Rankin.

This is only possible through the Get all companies endpoint at this time with the query parameter propertiesWithHistory=desired_property in the request URL.

I played around with a few variations on the Get a company endpoint, but unfortunately had no success.

Isaac Takushi

Associate Certification Manager
0 Upvotes
HubSpot_Corey
Contributor

API to fetch property history

SOLVE

Hi all, 

For those that still stumble across this forum. This is also now available with the V3 integrations, you can find the HubSpot Developer Doc here.  I've also quickly outlined the request below:

 

GET

/crm/v3/objects/companies/{companyId}

Parameter

Description

propertiesWithHistory

A comma separated list of the current and historical properties to be returned in the response. If the requested company doesn't have a value for a property, it will not appear in the response.

0 Upvotes
Louis_Rankin
Member

API to fetch property history

SOLVE

Hi Derek,

What is the parameter I need to include to get the property history for a company. Above you've listed the parameter for deals and contacts

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to fetch property history

SOLVE

Hi @peterkunhardt,

Pulling the full property version history is fairly resource intensive, so we intentionally omit a 'get all properties' history' flag for that endpoint. If you anticipate the need to keep track of every update to your properties, rather than just the current state of the property at the time you're polling for updates, you might consider a different solution, like taking advantage of the webhooks API:

0 Upvotes
Not applicable

API to fetch property history

SOLVE

Thanks Derek! I'll take a look and see what makes sense.

Not applicable

API to fetch property history

SOLVE

Hi @Derek_Gervais, thanks for the tip, I was afraid this was going to be impossible based on my first reading of the Hubspot API docs.

I am wondering if this strategy could possibly be employed during a get_company_properties call; from the docs you point out, it looks like in order to select the history of a given property, it has to be explicitly specified. This would mean that if we have a daily extract of all Hubspot data via Stitch or custom-built API and we institute a new custom field, it would be necessary to update the API calls to include the newly defined property. (Or to build the list of properties we want to extract by Getting all Properties and using that list to define the list of parameters to be passed to a Get all Companies call) Does that sound accurate?

Would be much easier if we could extract all properties w/ history during a Get all Companies call directly :wink:

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to fetch property history

SOLVE

Hi @thecoolcoder,

Property history is automatically tracked for all object properties, custom & default. The parameter for the Deals API is different, though; you'll need to include &includePropertyVersions=true instead.

0 Upvotes
thecoolcoder
Member

API to fetch property history

SOLVE

Derek, If I add a custom property field to a Deal record, will a history automatically be kept for such a text field, or do I have to label it using the API as a field that needs to keep a history??

Are you saying that by doing API calls that include "propertyMode=value_and_history" can give me the history of any and every field in Hubspot CRM Deal properties? Is there a limit on the number of history revisions?

Thanks in advance,

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to fetch property history

SOLVE

Hi @ashish.moradiya,

You’re not wrong, you can use the contacts API to get a contact’s properties and their history by including propertyMode=value_and_history parameter. This will not return a full list of page views for the contact, since page views aren’t stored in a property. What you could do is get the history of the Last Page Seen property; this property automatically updates with the last page HubSpot has seen your contact. With the property history, this property will give you information on the pages your contacts have visited. This isn’t guaranteed to exactly reflect timeline visit information, however.

0 Upvotes
asmoradiya
Member

API to fetch property history

SOLVE

Hello @Derek_Gervais,

Thanks for your answer, but I didn’t got it exactly. This document states history can be fetched via API - https://streamable.com/sddya

tell me if I am wrong.

Thanks,
Ashish

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

API to fetch property history

SOLVE

Hi @ashish.moradiya,

While you can use the contacts API to get a contact’s properties and their history by including propertyMode=value_and_history, but the page view information on a contact’s timeline isn’t stored in a contact property and therefore isn’t accessible via this method. It’s not currently possible to get individual pages viewed by a contact via the API.

0 Upvotes