Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a Space's Blog page contentID

Sam Joynson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2021

I'm trying to use the REST API to add users to the watch lists of a space's blog page (for example: https://confluence.com/pages/viewrecentblogposts.action?key=XYZ), so the equivalent of pressing this 'Watch this Blog' button on the blog page: image.pngUsing the API to get the content ID of any page or blog post is super easy but for the life of me I can't seem to find a way to get the contentID of the page where all the blog posts for a space are listed. Frustratingly this also seems to be the only page without a 'Page Information' tab either. 

If such a blog page doesn't have an contentID then how could I replicate the process of going to an individual blogpost and selecting the 'Watch for new blogs in this space' option when clicking the 'Watch' button of a blogpost: image.png This also allows the user to watch the space's blog page instead of just the individual blog post. 

2 answers

1 vote
Thomas Deiler
Community Champion
November 10, 2021

Dear @Sam Joynson ,

welcome to the community.

Have you tried this already?

https://myhost/rest/api/content?type=blogpost&spaceKey=SPACE&expand=body.view

So long

Thomas

Alex
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2025

@Thomas Deiler it's worked! Thank you!)

 

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2021

I suspect the page you are referring to in "...get the contentID of the page where all the blog posts for a space are listed..." is not a page!

I mean, yes, it is a web page, but it is not a Confluence page.  It is generated by the system for each space, there's no contentID for it because it's not content, it's structural!  That's also why it has no page information - it's not a confluence page!

I don't think it's possible to set the "watch all blogs in this space" via the REST API.  Closest you might get is probably to ask for all the blogs in the space, iterate over the result and add the flag manually, and have to repeat that regularly.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events