Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get page links of all the pages on my confluence space using the rest API ?

ravi April 7, 2015

Hi , 

Can somebody please help me what rest api do i need to use to get the page links for the space pages that i have on my confluence . 

Currently i am using this api but it doesn't show me any results for the page links , i want to display page links in my iOS application similar to hipchat application where they display all the modified content in their iOS application . 

API is - https://spaces.domain.com/rest/api/space/ANN/content/page?expand=body.view

ANN is my space name , i have 5 pages in the space and i want to get all their URL's in the rest api so that i can display them in my iOS application and when a user clicks this link in my iOS app it takes them to the particular page using UIWebView.

 

 

 



1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Davin Studer
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.
April 7, 2015

You can do something like this. However, if you have more than 500  items then you will have to do it in batches as the REST API will only return a max of 500 entries. Do this until the root size node is not 500.

http://wiki/rest/api/content?spaceKey=key&limit=500&start=0

http://wiki/rest/api/content?spaceKey=key&limit=500&start=500

http://wiki/rest/api/content?spaceKey=key&limit=500&start=1000

ravi April 7, 2015

Hi David, Thanks for your answer , i am getting the results . i have currently 5 pages in my space and i see the (title) attribute in the api call but i want the link to all those particular pages which i want to display in my app , but the api doesn't return them . To explain more clear . Say i have a space called - ANN there are 4 pages in it like below . 1. How to use IT 2. How to use Tube 3. How to use travis CI 4. How to use Clover now i want the link for each page using the rest api , but the link's that i get from the api call have rest/api/pagename in them which i don't want as clicking them leads to another api call , what i want from the api call is the page URL for a page which i can parse and show it in my iOS application where a user can click the url and open that particular page from the mobile application .

Davin Studer
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.
April 7, 2015

You should see in the JSON object a the root _links.base. Combine that with results[x]._links.webui.

TAGS
AUG Leaders

Atlassian Community Events