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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,987
Community Members
 
Community Events
184
Community Groups

How to get page information about a Confluence page via REST API: page metadata and links

Stan Ry
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.
May 23, 2019

Howdy,

I want to gather page information about every page in my space programmatically. I am planning to do so through Python. 

There's a metadata information called Page information for every page in Confluence. And this information is accessiable via URLs like:

https://example.net/wiki/pages/viewinfo.action?pageId=774671260

The page provides following metadata that describes page links, authors:

  • Title
  • Author
  • Last Changed by
  • Tiny Link
  • Incoming Links
  • Outgoing Links
  • Labels
  • Hot Referrers (what are these?)

Is there any way I could collect this info via a Python script and REST API? I have scanned https://example.net/wiki/plugins/servlet/restbrowser#/ REST Browser but haven't found any matching API that would nail this task.

I would be happy to hear some recommendations or examples of scripts -- Python or JavaScript -- that solve this. Every input is appreciated.

Thank you in advance.
 

2 answers

1 vote
Devin Shaw
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.
May 23, 2019

You can use the REST API, assuming your version of Confluence supports the following call:

 

Using requests library in Python or however you want, you can hit this endpoint: {Confluence Base URL}/rest/api/space/{Space Key}/content

 

This will give you the pages in a space and some information. You could then programmatically expand each page and grab the information you're looking for.  

HI @Stan Ry 

Could you do a search in Python?

I have the same job.

Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events