Skip to content

[Confluence] ConfluenceCloud: fix get_content_children and get_content_descendants - #1712

Merged
gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-content-children-descendants
Oct 30, 2026
Merged

gonchik merged 1 commit into
atlassian-api:masterfrom
LuisFigueroaG:fix/confluence-cloud-content-children-descendants

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

ConfluenceCloud.get_content_children(content_id) and get_content_descendants(content_id) (and the same methods on Confluence(url="https://<site>.atlassian.net")) send:

GET /wiki/rest/api/content/{id}/children
GET /wiki/rest/api/content/{id}/descendants

The Confluence Cloud v1 REST API doesn't have plural endpoints. Descendants are at /content/{id}/descendant (see the children and descendants reference and the v1 OpenAPI spec), and children were at /content/{id}/child (getContentChildren in the spec). /children and /descendants aren't in any version of the spec, so both calls always fail with a 404.

This switches both methods to the singular paths:

  • get_content_children -> GET /wiki/rest/api/content/{id}/child
  • get_content_descendants -> GET /wiki/rest/api/content/{id}/descendant

These are the paths the Server client's get_content_children()/get_content_descendants() use, and the same ones the Cloud get_child_pages() (/child/page), get_page_child_by_type() (/child/{type}) and get_descendant_pages() (/descendant/page) already build on. Arguments and return values are unchanged.

Note: GET /content/{id}/child was deprecated in CHANGE-864 and is no longer listed in the current v1 reference (/descendant is still there, also marked deprecated). The singular path is still the one that matches the API and the rest of the client.

Tests: updated test_get_content_children and test_get_content_descendants in tests/confluence/test_confluence_cloud.py (they asserted the plural paths) and added a parametrized test that checks the final URLs are https://test.atlassian.net/wiki/rest/api/content/123/child and .../123/descendant. The four tests fail on master. The full pytest suite, tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.

…t_descendants

Cloud.get_content_children and get_content_descendants request
/wiki/rest/api/content/{id}/children and /descendants, but the v1
content API names these endpoints in the singular (/child and
/descendant), so both calls fail with a 404.

Use the singular paths, the same ones the Server client and the Cloud
get_child_pages and get_descendant_pages already use.
@gonchik
gonchik merged commit 450faa7 into atlassian-api:master Oct 30, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants