APIs & Integrations

crossbill
Membro

Custom objects count (without paginating all objects)

resolver

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 Avaliação positiva
1 Solução aceita
weiliang_lee
Solução
Top colaborador(a) | Parceiro Diamante
Top colaborador(a) | Parceiro Diamante

Custom objects count (without paginating all objects)

resolver

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

Exibir solução no post original

0 Avaliação positiva
2 Respostas 2
weiliang_lee
Solução
Top colaborador(a) | Parceiro Diamante
Top colaborador(a) | Parceiro Diamante

Custom objects count (without paginating all objects)

resolver

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 Avaliação positiva
storycollab
Participante | Parceiro Diamante
Participante | Parceiro Diamante

Custom objects count (without paginating all objects)

resolver

Is this fix still operational?

 

0 Avaliação positiva