Hello Team,
I have a page ID and would like to find the name of the space where it's located. Is there a way I can do this? Maybe using some API?
Regards
Hi @Sal ,
you can retrive all the space information associated using the following REST https://docs.atlassian.com/ConfluenceServer/rest/7.17.1/#content-getContentById
You should be able to get Space info associated :
...."space": { "title": "Space", "type": "object", "properties": { "id": { "type": "integer" }, "key": { "type": "string" }, "name": { "type": "string" }, "icon": { "type": "array", "items": { "$ref": "#/definitions/icon" } },
Hope this helps,
Fabio
Hi @Sal
If you have permissions to view the page you can use this URL format:
<base URL>/pages/viewpage.action?pageId=<pageid>
Hope this helpsKind regardsJorden
Hi @Sal welcome to the Atlassian community.
I found your query interesting and did some search to pull out this document the speaks about "Children Display Macro". This might be a good starting point if you haven't explored already.
@Fabio Racobaldo _Catworkx_ This page has restrictions on it and I can't get details after running with page ID.
I will need the space name to remove the restrictions on the page. Any other suggestions you have?
if so, you need to perform a query at DB level like the following :
select sp.*from content coninner join spaces sp on I(con.SPACEID=sp.SPACEID)where con.CONTENTTYPE = 'PAGE'and con.CONTENTID=YOUR_PAGE_ID_HERE;
If you just need to get the Space and the linked page in human readable for one time (without Macro etc.) you just could try to open that page and look into the Audit log, cause a request for a restricted page, where you don´t have the needed rights will result in a audit log listing. In the audit log the space and respective page is linked.
hope that helps.
It looks like you're new here. Sign in or register to get started.