How can I create a list of all spaces and pages on the Company confluence account?

carmendelgado
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!
July 16, 2019

Hello, I'm trying to create a list of all spaces and pages inside each space for all the documents created under the Company confluence account.

Also to include a kind of description for each spaces and page.

1 answer

1 vote
Boris MBOUMEHANG
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 17, 2019

Hello Carmen, 

Welcome to the Atlassian Community. It is good to have you with us. 

There is a macro with permits you to list all you spaces in a Confluence page, which is named Space List. An there is another one which permits you to have a list of all the pages you've got into a specific space, into a Confluence page: Page Index
But, those two macros will not meet efficiently your need in my own opinion, as the data you need will only be available on Confluence, and will not be ordered as you want.

Another way to meet your need is to use the Confluence Cloud REST API. In fact, below is an algorithm that you could follow:

  • Authenticate to your Confluence Cloud site with an Atlassian account which "Cas use" Confluence, and which has access to all the spaces you will need to have a list : Basic auth for Rest APIs;
  • Get the list of spaces with the API call: GET /wiki/rest/api/space.
    The output will be in JSON, so you will be able to parse it to retrieve only the name of the description of each space as you want. Then store them in an object or in a file;
  • For each space you've got, get the list of the pages it contains with the following API call: GET /wiki/rest/api/space/{spaceKey}/content.
    The output will be in JSON, so you will be able to parse it to retrieve only pages by filtring the "type" string. Then store them in an object or a file.


Hope this will help you. 

Thanks.
Boris

Lakshman Aarepu November 27, 2023

Thank you Boris.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events