APIs & Integrations

cdw9
Member

Blog API not returning latest data

I am using ttps://api.hubapi.com/content/api/v2/blog-posts to return a specific blog post. I get JSON for the correct post, but it does not seem to contain the latest data. For example, I think the slug/url for the post was changed at some point, but the JSON is only providing me with the old path. url and slug are both wrong, and published_url is None.

Is there something I need to do to make sure to get the latest data, or is this a bug in Hubspot’s API?

0 Upvotes
2 Replies 2
cdw9
Member

Blog API not returning latest data

Hmm, seems I was using an old ID for retrieving the blog post, maybe someone recreated it. Do the IDs change?

0 Upvotes
Dadams
HubSpot Employee
HubSpot Employee

Blog API not returning latest data

@cdw9 The ID for a specific blog post would not change, and you should always get the current saved data for the blog post. The only exception might be the auto-save buffer, if you’re editing the post in the HubSpot app and getting the post through the API at the same time:

Gets the current contents of the auto-save buffer | COS Blog API

GET /content/api/v2/blog-posts/:blog_post_id/buffer - The auto-save buffer is updated continuously when a user is editing the content through the UI. Only when the user clicks "Save" or "Publish" does the auto-save buffer get copied to the live...

0 Upvotes