Confluence API:如何从以前版本的页面获取内容?

问题描述 投票:0回答:1

我正在为Confluence实现一个附加组件。我需要从以前版本的页面中检索内容。我设法从当前版本获取内容,但我无法获得以前版本的内容。我只得到历史......

我通过以下版本获取当前版本的内容:https://MYLINK/rest/api/content?spaceKey=MYSPACEKEY&title=MYTITEL&expand=space,body.view,version,container

我如何在这里选择版本?如果我写的版本= 12,我什么也得不到,如果我只写12个例子,我会再次获得最新版本,而不是旧版本......

confluence confluence-rest-api
1个回答
0
投票

我找到了解决方案如何获取所有版本的列表以及如何打印内容。所需的API是:

History / List of all versions for the specific page

https://LINK/rest/experimental/content/THEPAGEID/version?expand=content

Get content for a specific version of a page

https://LINK/rest/api/content/PAGEID?status=historical&version=PAGEVERSIONNUMBER&expand=space,body.view,version,container

Get content for the current version of a page

https://LINK/rest/api/content?spaceKey=~YOURSPACEKEY&title=TITELOFTHEPAGE&expand=space,body.view,version,container

© www.soinside.com 2019 - 2024. All rights reserved.