APIs & Integrations

mlavigne
参加者

Not getting the field total_count on List blog posts call

解決

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 いいね!
1件の承認済みベストアンサー
IsaacTakushi
解決策
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

解決

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 いいね!
5件の返信
IsaacTakushi
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

解決

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 いいね!
mlavigne
参加者

Not getting the field total_count on List blog posts call

解決

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 いいね!
IsaacTakushi
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

解決

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 いいね!
IsaacTakushi
解決策
HubSpot Employee
HubSpot Employee

Not getting the field total_count on List blog posts call

解決

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 いいね!
mlavigne
参加者

Not getting the field total_count on List blog posts call

解決

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