APIs & Integrations

crossbill
メンバー

Custom objects count (without paginating all objects)

解決

Is there an API endpoint available that allows me to get the total count of custom objects for a particular schema, without paginating through all the objects using the "crm/v3/objects/{objectType"?

 

For example, would be great if in the payload sent back from endpoint (above), an additional field would be included like:

 

page: { next: null},total_count: 35000

I suspect there's probably some sort of API (perhaps internally available to hubspot only) that reveals the total count, given that at the top of the Hubspot console page/dashboard, the total count of items is displayed. Without that scalar value (total count) available, we would be required to pagination through all pages, an expensive operation (in terms of number of API calls) since each request permits only 100 records to be returned at a time...so if we have 30000 custom objects, we'd need to issue 300 API calls.

 

Source: https://developers.hubspot.com/docs/api/crm/crm-custom-objects

0 いいね!
1件の承認済みベストアンサー
weiliang_lee
解決策
トップ投稿者 | Diamond Partner
トップ投稿者 | Diamond Partner

Custom objects count (without paginating all objects)

解決

Hi there,

 

Try using the search endpoint:

/crm/v3/objects/{object}/search

 

Using the Contacts Object as an example, the List endpoint doesn't give the total count indeed. But using the Search endpoint, the payload would include the "total" property. (You can use the Search endpoint and provide an empty body in the request, that would net the same results as doing a List).

weiliang_lee_0-1669948763451.png

 

Cheers

WL

元の投稿で解決策を見る

0 いいね!
2件の返信
weiliang_lee
解決策
トップ投稿者 | Diamond Partner
トップ投稿者 | Diamond Partner

Custom objects count (without paginating all objects)

解決

Hi there,

 

Try using the search endpoint:

/crm/v3/objects/{object}/search

 

Using the Contacts Object as an example, the List endpoint doesn't give the total count indeed. But using the Search endpoint, the payload would include the "total" property. (You can use the Search endpoint and provide an empty body in the request, that would net the same results as doing a List).

weiliang_lee_0-1669948763451.png

 

Cheers

WL

0 いいね!
storycollab
参加者 | Diamond Partner
参加者 | Diamond Partner

Custom objects count (without paginating all objects)

解決

Is this fix still operational?

 

0 いいね!