fix: Use Confluence v2 API for page reads

The v1 /wiki/rest/api/content/{id} endpoint returns 410 Gone.
Switch to /wiki/api/v2/pages/{id} with body-format=storage parameter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-02-26 11:08:29 +02:00
parent 3a5d37fac2
commit 9a879f566d

4
bot.py
View File

@@ -458,8 +458,8 @@ class AtlassianClient:
try: try:
async with httpx.AsyncClient(timeout=15.0) as client: async with httpx.AsyncClient(timeout=15.0) as client:
resp = await client.get( resp = await client.get(
f"https://api.atlassian.com/ex/confluence/{cloud_id}/wiki/rest/api/content/{page_id}", f"https://api.atlassian.com/ex/confluence/{cloud_id}/wiki/api/v2/pages/{page_id}",
params={"expand": "body.storage,version"}, params={"body-format": "storage"},
headers={"Authorization": f"Bearer {token}"}, headers={"Authorization": f"Bearer {token}"},
) )
resp.raise_for_status() resp.raise_for_status()