APIs & Integrations

hari0
参加者

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

解決

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 いいね!
2件の承認済みベストアンサー
webdew
解決策
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

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

解決

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.

元の投稿で解決策を見る

dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

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

解決

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

元の投稿で解決策を見る

0 いいね!
9件の返信
webdew
解決策
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

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

解決

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
参加者

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

解決

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 いいね!
webdew
ガイド役 | Diamond Partner
ガイド役 | Diamond Partner

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

解決

No @hari0 this is the only API.

0 いいね!
dennisedson
解決策
HubSpot製品開発チーム
HubSpot製品開発チーム

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

解決

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

0 いいね!
hari0
参加者

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

解決

Hi @dennisedson ,

 

Thanks for the reply.

 

Great, Then i can use the `recently_updated` API

0 いいね!
tominal
ガイド役 | Solutions Partner
ガイド役 | Solutions Partner

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

解決

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
参加者

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

解決

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製品開発チーム
HubSpot製品開発チーム

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

解決

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
参加者

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

解決

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 いいね!