从Confluence REST Api获取整个空间内容 [英] Get whole Space Content from Confluence REST Api

查看:172
本文介绍了从Confluence REST Api获取整个空间内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从REST Api中获得Confluence空间的全部内容?

Is it possible to get the whole content of a Confluence Space from REST Api?

我尝试以下示例curl -u admin:admin http://localhost:8080/confluence/rest/api/content/3965072?expand=body.storage

I try this example curl -u admin:admin http://localhost:8080/confluence/rest/api/content/3965072?expand=body.storage

但这只是第一页的内容.

But this is only the first page content.

推荐答案

在与我合作的Confluence RestAPI中,认识到每个页面在概念上都类似于Space十分重要,因为它可能还包含其他页面.页面上还悬挂着诸如附件之类的东西.我记得这个过程大致是这样的:

In the Confluence RestAPIs with which I worked it was important to recognize that every page is conceptually similar to a Space in that it may also contain other pages. There are also collections of things, like attachments, that hang off of the pages. As I recall the process is roughly this:

  • 获取空格集合.
  • 重复空间的收集,直到没有更多为止.
    • 对于每个空间,获取其页面集合;我想到了根页面".
      • 迭代/递归根页面集合,以检索所需的所有页面内容和/或附加的东西".
        • 递归是这里的关键.

        注意我之前的评论,有关确保您针对特定版本引用正确的Confluence RestAPI文档.这对我来说是个极大的困惑.

        Note my earlier comment about making sure you reference the correct Confluence RestAPI documentation for your specific version. That was a point of GREAT confusion for me.

        这篇关于从Confluence REST Api获取整个空间内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆