APIs & Integrations

hari0
Participante

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

resolver

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 Me gusta
2 Soluciones aceptadas
webdew
Solución
Guía | Partner nivel Diamond
Guía | Partner nivel Diamond

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

resolver

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.

Ver la solución en mensaje original publicado

dennisedson
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

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

resolver

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

Ver la solución en mensaje original publicado

0 Me gusta
9 Respuestas 9
webdew
Solución
Guía | Partner nivel Diamond
Guía | Partner nivel Diamond

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

resolver

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
Participante

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

resolver

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 Me gusta
webdew
Guía | Partner nivel Diamond
Guía | Partner nivel Diamond

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

resolver

No @hari0 this is the only API.

0 Me gusta
dennisedson
Solución
Equipo de producto de HubSpot
Equipo de producto de HubSpot

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

resolver

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

0 Me gusta
hari0
Participante

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

resolver

Hi @dennisedson ,

 

Thanks for the reply.

 

Great, Then i can use the `recently_updated` API

0 Me gusta
tominal
Guía | Partner
Guía | Partner

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

resolver

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
Participante

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

resolver

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
Equipo de producto de HubSpot
Equipo de producto de HubSpot

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

resolver

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
Participante

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

resolver

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 Me gusta