如何通过父页面标题检索 Confluence 中的所有子页面?

Jud*_*udi 4 python rest confluence

我知道如何通过标题检索 Confluence 中的页面

res = requests.get(BASE_URL + "/confluence/rest/api/content", params={"title": "parent page title"} , auth=("username", "pass"))
Run Code Online (Sandbox Code Playgroud)

https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples

如何检索给定父页面标题的所有子页面?

ppa*_*ler 7

据我所知,您无法通过父页面的title搜索子页面。您需要使用父母的Id进行搜索。

尝试以下方法获取父 ID:

/rest/api/content/search?cql=title=<parentTitle>
Run Code Online (Sandbox Code Playgroud)

如果您只有父母的头衔,则需要先发送第二次调用以从头衔中获取 id

/rest/api/content/search?cql=parent=<parentId>
Run Code Online (Sandbox Code Playgroud)

无法使用/confluence/rest/api/content找到 Id 和孩子,所以这是行不通的:

res = requests.get(BASE_URL + "/confluence/rest/api/content", params={"parent": "<parentId>"} , auth=("username", "pass"))

res = requests.get(BASE_URL + "/confluence/rest/api/content", params={"title": "parents title"} , auth=("username", "pass"))
Run Code Online (Sandbox Code Playgroud)