APIs & Integrations

mlavigne
Participante

Not getting the field total_count on List blog posts call

resolver

Hi,

 

I use to get a property total_count on the return json when calling /content/api/v2/blog-posts as per the documentation here:

 

https://developers.hubspot.com/docs/methods/blogv2/get_blog_posts

 

My logic relies on this property but it's now missing. Is that a bug, api change, am I the only one missing this field? I'm wondering if it is safe to rely on this value.

 

Thanks,

0 Avaliação positiva
1 Solução aceita
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

resolver

Hi, @mlavigne.

 

The team confirmed that total should be used in place of total_counts and that the values should match. We will be updating the documentation accordingly.

 

If you're seeing discrepancies between the number of objects returned and the total value, could you share an example response via direct message which exhibits the issue?

Isaac Takushi

Associate Certification Manager

Exibir solução no post original

0 Avaliação positiva
5 Respostas 5
IsaacTakushi
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

resolver

Hi, @mlavigne.

 

Something does seem to have changed. The response I receive from the List blog posts endpoint no longer matches the JSON example here.

 

While I don't receive a total_count field, as documented, I do see a total field at the bottom of the payload alongside the offset.

 

Do you see a total field returned?

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
mlavigne
Participante

Not getting the field total_count on List blog posts call

resolver

Hi @IsaacTakushi,

 

Thanks for your reply. I do recieved the total field at the bottom of the response but it doesn't match the number of return objects like the total_count did. 

 

Today we have changed our logic to count the numbers of objects in the response instead of relying on the total_count field.

 

Thanks,

 

0 Avaliação positiva
IsaacTakushi
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

resolver

Hi, @mlavigne.

 

Thanks for the additional context. I'm glad you have a workaround for the moment.

 

@WendyGoh and I will confirm whether total should match what was formerly returned in total_count and update this thread accordingly.

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

resolver

Hi, @mlavigne.

 

The team confirmed that total should be used in place of total_counts and that the values should match. We will be updating the documentation accordingly.

 

If you're seeing discrepancies between the number of objects returned and the total value, could you share an example response via direct message which exhibits the issue?

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
mlavigne
Participante

Not getting the field total_count on List blog posts call

resolver

Thank you for the prompt reply @IsaacTakushi, much appreciated.