Forums

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

How to get Blog Page ID?

Jeremy Price
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.
July 30, 2019

I know how to get a Page ID from any page in confluence by going to the page information or even seeing it in the URL when editing a page. 

 

However I can't seem to find a way to find the blog ID for a specific blog that I am on?

 

Is there away to find this through the API? 

1 answer

1 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 8, 2019

Hello Jeremy,

Thank you for contacting us! I see that you raised this question in support and my colleague has assisted you. 

Your question here was tagged as Confluence Cloud, but you had asked in the Server collection, so these instructions below are for Server. If you still needed this for Cloud, and this information doesn't help you, please let me know. 

For the rest of the Community, here was the reply that helped Jeremy:

Using our Confluence REST API examples, I was able to find it with the following command:

curl -u admin:admin -X GET "http://localhost:8090/rest/api/content/search?cql=type=blogpost" 

You may need to re-adjust it according to your Base URL.

I got the following result from the command line:

{"results":[{"id":"#######","type":"blogpost","status":"current","title":"Blopost Pagina","restrictions":{},"_links":{"webui":"/display/TEST/2019/08/02/Blopost+Pagina","tinyui":"/x/A4AX","self":"http://gviana:8090/rest/api/content/1540099"},"_expandable":{"container":"","metadata":"","extensions":"","operations":"","children":"","history":"/rest/api/content/1540099/history","ancestors":"","body":"","version":"","descendants":"","space":"/rest/api/space/TEST"}}],"start":0,"limit":25,"size":1,"_links":{"self":"http://gviana:8090/rest/api/content/search?cql=type=blogpost","base":"http://gviana:8090","context":""}}

It returned the *#######* id, which is the PageID of the blogpost. If you have more than one blogpost, it will bring more than one result.

You can also try to cURL only the name of the blogpost:

curl -u admin:admin -X GET "http://localhost:8090/rest/api/content?title=Another%20blog&type=blogpost" 

You can see that I used only the "title" and the "type" filter.

Best regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events