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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to retrieve metadata from Page Properties using REST API

Dear Experts, 

As per the documentation "https://developer.atlassian.com/confdev/development-resources/preparing-for-confluence-5-4" Confluence 5.4 exposes a REST API to retrieve metadata in page properties. 

image2016-5-23 11:42:14.png

But I couldn't find a way to retrieve this data from the REST Resources documenatation. https://docs.atlassian.com/confluence/REST/latest/ or previous versions, all I can see is a resource to set and get the Properties for a page stored internally and is not visible to the readers in anyway using /rest/api/content/{id}/property

Can someone help me identify the correct API to retrieve page properties metadata. 

Any help is much appreciated. 

 

-- Sharath

2 answers

I'm posting the results of my research to fill in some details of the smartics answer.  Using curl (with netrc basic auth):

curl -n -G "https://yourconfluenceserver/confluence/rest/masterdetail/1.0/detailssummary/lines?spaceKey=YOURSPACE" --data-urlencode "cql=label=service" 

The cql stuff seems to be necessary; use a cql search that returns the pages you want.  Other examples are "cql=id=1234567890" for a specific page id or "cql=title~Demo AND space.key=MYSPACE".  
The json output can be parsed to get the page properties.  Using the jq cli tool:
`jq -r '.renderedHeadings[]'` extracts the keys
`jq -r '.detailLines[].details[]` will extract corresponding values

I think you are looking for the masterdetail service:

rest/masterdetail/1.0/detailssummary/lines

If your are using the REST browser (plugins/servlet/restbrowser) you need to uncheck "Show only public APIs".

Just in case you are looking for services not only to access document properties but also space properties or document sections, you could have a look at the Web API Extension that is based on our commercial projectdoc Toolbox. Both are available on the Atlassian Marketplace:

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

🤺 Atlympic Event: Partnerships

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

59 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you