Confluence Cloud API v2 get page by ID - Empty Body

Hello,

I am currently using the Confluence Cloud version and utilizing the API v2 get page by ID endpoint to retrieve the contents of a specific page.
While I am able to successfully retrieve the title and other information, the body is returned empty as {}.

To troubleshoot, I have taken the following steps:

  • Tested with different page IDs.
  • Tried using the expand=body and expand=body.storage options in the get query.

Despite these efforts, the body content remains empty.
I would appreciate any additional advice or solutions to resolve this issue.

Here is the resulting JSON with masked information for privacy protection:

{
    "_links": {
        "base": "https://<instance>.atlassian.net/wiki",
        "editui": "/pages/resumedraft.action?draftId=<masked>",
        "tinyui": "/x/<masked>",
        "webui": "/spaces/AA/pages/<masked>"
    },
    "authorId": "<masked>",
    "body": {},
    "createdAt": "2020-04-22T08:23:20Z",
    "id": "<masked>",
    "lastOwnerId": null,
    "ownerId": "<masked>",
    "parentId": "<masked>",
    "parentType": "page",
    "position": <masked>,
    "spaceId": "<masked>",
    "status": "current",
    "title": "개발 환경 세팅 매뉴얼",
    "version": {
        "authorId": "<masked>",
        "createdAt": "2024-04-04T02:10:31.000Z",
        "message": "",
        "minorEdit": false,
        "number": 5
    }
}

Thank you.

The query parameter you’re looking for is body-format (see the “Get page by id” documentation), e.g., /wiki/api/v2/pages/{id}?body-format=storage. The expand parameter is only used in v1 APIs.

2 Likes

Thank you for the solution.

I confused the options while migrating from the server version to the cloud version.

Really appreciate your help.

1 Like