APIs & Integrations

hari0
Participant

[New APIs] Get all the updated records from an object type

SOLVE

I am working on an integration application that uses HubSpot along with other data to provide AI-based suggestions and pain points to the customer.

 

We need to fetch and sync the HubSpot data periodically for this.

 

I am using the LIST GET API to fetch all the data from an object

/crm/v3/objects/companies/5803412850/associations/contacts?hapikey=

 

And using the SEARCH POST API to periodically sync the data. Based on the `lastmodifieddate` property.

 

crm/v3/objects/contacts/search?hapikey=

{
    "filterGroups": [
        {
            "filters": [
                {
                    "operator": "GT",
                    "propertyName": "lastmodifieddate",
                    "value": "1617630924000"
                }
            ]
        }
    ]
}

 

But this field doesn't exist for all the object types, Eg: It doesn't exist for Companies object type.

 

Is there any way to search the data based on the `updatedAt` field from the records?  As this seems to be a field present for all object records.

There is also the `hs_lastmodifieddate` field. But it mentions that this field will also be updated when HubSpot changes some internal fields. So this would not be the best choice.

0 Upvotes
2 Accepted solutions
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

[New APIs] Get all the updated records from an object type

SOLVE

Hi @hari0 ,

Have you tried this below api?

Link : https://legacydocs.hubspot.com/docs/methods/contacts/get_recently_updated_contacts

URL : https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=2

Use above url and when you will get updated contact result then filter in array.

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

View solution in original post

dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

[New APIs] Get all the updated records from an object type

SOLVE

@hari0 , the legacy APIs are fully supported unless marked as deprecated.  You should not worry about the support 😀

View solution in original post

0 Upvotes
9 Replies 9
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

[New APIs] Get all the updated records from an object type

SOLVE

Hi @hari0 ,

Have you tried this below api?

Link : https://legacydocs.hubspot.com/docs/methods/contacts/get_recently_updated_contacts

URL : https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=2

Use above url and when you will get updated contact result then filter in array.

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

hari0
Participant

[New APIs] Get all the updated records from an object type

SOLVE

Hi @webdew ,

 

I had seen the `recently_updated` API. But it's from the legacy API list. Is there a new API added which matches this legacy API?

 

0 Upvotes
webdew
Guide | Diamond Partner
Guide | Diamond Partner

[New APIs] Get all the updated records from an object type

SOLVE

No @hari0 this is the only API.

0 Upvotes
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

[New APIs] Get all the updated records from an object type

SOLVE

@hari0 , the legacy APIs are fully supported unless marked as deprecated.  You should not worry about the support 😀

0 Upvotes
hari0
Participant

[New APIs] Get all the updated records from an object type

SOLVE

Hi @dennisedson ,

 

Thanks for the reply.

 

Great, Then i can use the `recently_updated` API

0 Upvotes
tominal
Guide | Partner
Guide | Partner

[New APIs] Get all the updated records from an object type

SOLVE

I would still do a periodic "get all" request, but yes webhooks looking for specific property changes may suit you without know more about your integration.

 

Hope that helps!


Thomas Johnson
Community Champion


Kahu Software LLC
A Texan HubSpot consulting firm
https://kahusoftware.com
hari0
Participant

[New APIs] Get all the updated records from an object type

SOLVE

Hi @tominal ,

 

Thanks for the reply.

 

We are interested in all the properties for Contacts and Companies objects. So using Webhooks can easily lead to a lot of requests to our backend.

Periodic sync using the Search API ensures that we get only the data that we want (Updated/Deleted data) when we want it.

 

I guess we can use `hs_lastmodifieddate` and search based on the required timestamp

dennisedson
HubSpot Product Team
HubSpot Product Team

[New APIs] Get all the updated records from an object type

SOLVE

Hey @hari0 !

On the surface, this seems like a good use case for webhooks so you can subscribe to changes rather than having to periodically do a dump.

@RMones , @tominal might have better advice than I can offer (they usually do 😉)

hari0
Participant

[New APIs] Get all the updated records from an object type

SOLVE

Hi @dennisedson 

 

Thanks for the reply

 

I was hoping to avoid the use of webhooks. Currently we are interested in all the properties we can get from the objects. So using webhooks can lead the architecture being too chatty

0 Upvotes