0

I'm trying to fetch the value of an item in a metadata list on a page in Confluence using the REST API. So far I have been able to extract fetch the body using a URL like this

https://acme.com/rest/api/content/105088446?expand=body.storage (documentation here: https://developer.atlassian.com/confdev/confluence-server-rest-api/expansions-in-the-rest-api)

Or the full contents of the metadata list macro like this https://acme.com/rest/api/content/105088446/history/10/macro/id/c65d00a3-49e2-40e5-a032-50b6c187d968 (documentation here: https://docs.atlassian.com/confluence/REST/latest/#content)

But neither of these are satisfactory. The first leaves a lot of parsing, the second requires I define the version of the page and even then returns the whole table that needs to be parsed.

Craig
  • 8,093
  • 8
  • 42
  • 74
  • Provided links return an HTTP 404 - Not Found. We cannot understand what you try to perform and how the data is generated for example. – mtheriault Sep 16 '16 at 14:09
  • Yeah they return 404, they are to an imaginary domain called 'acme.com', the point of those links is the form of the url e.g. 'api/content/{content_id}/history/...'. After each of my example urls is a link tot eh documentation that shows how those urls were derived. – Craig Sep 17 '16 at 04:31
  • OK, but macro are all different. No API call will return directly a specific part or element of the macro. You will need to parse the body 'storage' or 'view'. It's why I ask you a sample of the response. – mtheriault Sep 18 '16 at 10:16
  • Right, but I can fetch the content of a macro from the a specific version of the page. It would be helpful if I could specify getting the _latest_ version of the page. Since the macro has a guid it seems reasonable to do that. – Craig Sep 18 '16 at 20:32

1 Answers1

1

I'm not sure if you are referring to the page properties (Page Properties Macro). If so you could try the masterdetails REST service.

rest/masterdetail/1.0/detailssummary/lines

You can use the REST API Browser to discover the parameters (note that this is part of the non-public API, so you need to check of the "Show only public APIs" checkbox to see it in the list).

There is a similar question on Atlassian Answers.

Robert Reiner
  • 531
  • 3
  • 9
  • It's not the page properties that I'm fetching, but data writing into he content of the page, usually using the a metadata table. – Craig Oct 18 '16 at 20:37