Confluence REST API - getting a list of pages with a short excerpt or abstract for any page

cbertelli November 7, 2017

Hello,

the tile says almost all. I would like to include a short excerpt of the text when listing pages (children of one page).

If that is not possible without a recursion (to query any page in the list to get a part of the content – say the first period), another possible way could be stocking metadata properties with a specially crafted test. Would this be accessible while reading the list?

1 answer

1 vote
Aleksandr Zuevich
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.
November 8, 2017

Hi, I think short excerpt is not possible. By the way look at metadata properties:

/wiki/rest/api/content?expand=metadata.properties

cbertelli November 11, 2017

Metadata.properties cannot provide a proper solution, you are right, but what about content.properties?

Could it be feasible to add a content property with an excerpt of the page (and maybe another with the URL of an image thumbnail) and retrieve it anytime I get a list of pages?

Aleksandr Zuevich
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.
November 11, 2017

If you preliminarily set your own property to each page using POST /rest/api/content/{pageId}/property e.g. {key: "excerpt", value: "a short excerpt of the text"} then you can get it using GET /wiki/rest/api/content?expand=metadata.properties.excerpt

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events