问题
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:
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
来源:https://stackoverflow.com/questions/34353955/confluence-rest-api-expanding-page-body-when-retrieving-page-by-title