Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-78369

GET /wiki/api/v2/pages with the body-format=atlas_doc_format parameter is missing macroOutput and text properties

    XMLWordPrintable

Details

    Description

      Issue Summary

      The batch page retrieval endpoint

      GET /wiki/api/v2/pages?body-format=atlas_doc_format

      does not return the macroOutput property for macros and the text property for mentions, unlike the single page retrieval endpoint

      GET /wiki/api/v2/pages/{id}?body-format=atlas_doc_format

      This inconsistency leads to incomplete data retrieval when using the first endpoint when theyre both meant to be sending the same response. 

      Steps to Reproduce

      1. Create a confluence page with a Mention and Macro property.
      2. Fetch multiple pages using the batch endpoint GET /wiki/api/v2/pages?body-format=atlas_doc_format and you'll get the following: 
        {
          "atlas_doc_format": {
            "value": {
              "type": "doc",
              "content": [
                {
                  "type": "paragraph",
                  "content": [
                    {
                      "text": "Hello test",
                      "type": "text"
                    }
                  ]
                },
                {
                  "type": "paragraph",
                  "content": [
                    {
                      "type": "mention",
                      "attrs": {
                        "id": "xxxxx"
                      }
                    },
                    {
                      "text": " ",
                      "type": "text"
                    }
                  ]
                },
                {
                  "type": "paragraph",
                  "content": [
                    {
                      "type": "inlineExtension",
                      "attrs": {
                        "extensionType": "com.atlassian.confluence.macro.core",
                        "extensionKey": "profile-picture",
                        "parameters": {
                          "macroParams": {
                            "User": {
                              "value": "xxxxx"
                            }
                          },
                          "macroMetadata": {
                            "macroId": {
                              "value": "xxxxx"
                            },
                            "schemaVersion": {
                              "value": "1"
                            },
                            "placeholder": [
                              {
                                "type": "image",
                                "data": {
                                  "url": "/aa-avatar/xxxxx"
                                }
                              }
                            ],
                            "title": "Profile Picture"
                          }
                        },
                        "localId": "xxxxx"
                      }
                    }
                  ]
                },
                {
                  "type": "paragraph"}
              ],
              "version": 1
            },
            "representation": "atlas_doc_format"
          }
        } 

        3. Fetch the newly created page using the single page endpoint GET /wiki/api/v2/pages/{id}?body-format=atlas_doc_format and response is like the following:

      {
        "value": {
          "type": "doc",
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "text": "Hello test",
                  "type": "text"
                }
              ]
            },
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "mention",
                  "attrs": {
                    "id": "xxxxx",
                    "text": "@Sherica Fabienne Ocbania"
                  }
                },
                {
                  "text": " ",
                  "type": "text"
                }
              ]
            },
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "inlineExtension",
                  "attrs": {
                    "extensionType": "com.atlassian.confluence.macro.core",
                    "extensionKey": "profile-picture",
                    "parameters": {
                      "macroParams": {
                        "User": {
                          "value": "xxxxx"
                        }
                      },
                      "macroMetadata": {
                        "macroId": {
                          "value": "xxxxx"
                        },
                        "schemaVersion": {
                          "value": "1"
                        },
                        "placeholder": [
                          {
                            "type": "image",
                            "data": {
                              "url": "/aa-avatar/xxxxxx"
                            }
                          }
                        ],
                        "title": "Profile Picture"
                      },
                      "macroOutput": "<a class=\"userLogoLink conf-macro output-inline\" data-account-id=\"xxxxx\" data-hasbody=\"false\" data-local-id=\"xxxxx\" data-macro-id=\"xxxxx\" data-macro-name=\"profile-picture\" data-username=\"xxxxx\" href=\"https://yoursite.atlassian.net/wiki/people/xxxxx?ref=confluence\" target=\"_blank\" title=\"\"><img class=\"userLogo-48 logo\" src=\"/wiki/aa-avatar/xxxxx\" alt=\"User icon: Sherica Fabienne Ocbania\" title=\"\" /></a>"
                    },
                    "localId": "xxxxx"
                  }
                }
              ]
            },
            {
              "type": "paragraph"
            }
          ],
          "version": 1
        },
        "representation": "atlas_doc_format"
      } 

      4. Compare the responses from both endpoints.

      Expected Results

      Both endpoints should return consistent data structures, including the macroOutput property for macros and the text property for mentions. Ideally the batch version of this API would return all data, otherwise you'd have to hit the API once for every page to ensure I retrieve all data. 

      Actual Results

      The batch endpoint's response lacks the macroOutput and text properties, leading to data inconsistency and potentially necessitating multiple API calls to ensure complete data retrieval.

      Workaround

      To obtain complete data including macroOutput and text properties, individual calls must be made to the single page endpoint for each page. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            26a024868f5f Sherica Ocbania
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: