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
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.