Confluence REST API - expanding page body when ret

2019-07-10 02:19发布

I'm accessing a Confluence page by its title using the latest REST API. To retrieve more details on certain fields, I'm passing the expand parameter (see Confluence Docs):

https://xyz.atlassian.net/wiki/rest/api/content/?title=Architecture&spaceKey=XX&expand=body

or

https://xyz.atlassian.net/wiki/rest/api/content/?title=Architecture&spaceKey=XX&expand=body.view

But the results don't hold any information on the found page body.

Note, this is working fine with requests using a page id only. Using the title to retrieve the page is threaded similar to search results, hence the expand feature seems not to work the same. According to the documentation it should work as per my example. Am I missing something?

1条回答
甜甜的少女心
2楼-- · 2019-07-10 02:44

You need to specify which type of "body" you want in the expansion parameter.

In your case, something like this:

https://xyz.atlassian.net/wiki/rest/api/content/?title=Architecture&spaceKey=XX&expand=body.view

https://xyz.atlassian.net/wiki/rest/api/content/?title=Architecture&spaceKey=XX&expand=body.export_view

Possible values are:

  • editor
  • export_view
  • anonymous_export_view
  • view
  • storage
查看更多
登录 后发表回答