Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-41313

Table of Contents macro is empty through REST API

    XMLWordPrintable

Details

    Description

      Problem

      On Confluence 5.8.x and above, when using the REST API to extract the contents of a page, Confluence does not return the contents of the Table of Contents macro.

      Expected behavior

      When using the following REST call, the response should contain the contents of the TOC macro.

      curl -u admin:admin http://localhost:8090/confluence/rest/api/content/491524?expand=body.view
      {"id":"491524","type":"page","status":"current","title":"TOC/REST API test","body":{"view":{"value":"<p><style type='text/css'>/*<![CDATA[*/\ndiv.rbtoc1460022235112 {padding: 0px;}\ndiv.rbtoc1460022235112 ul {list-style: disc;margin-left: 0px;}\ndiv.rbtoc1460022235112 li {margin-left: 0px;padding-left: 0px;}\n\n/*]]>*/</style><div class='toc-macro rbtoc1460022235112'>\n<ul class='toc-indentation'>\n<li><a href='#TOC/RESTAPItest-heading1'>heading 1</a></li>\n<li><a href='#TOC/RESTAPItest-heading2'>heading 2</a></li>\n</ul>\n</div></p><h1 id=\"TOC/RESTAPItest-heading1\">heading 1</h1><h1 id=\"TOC/RESTAPItest-heading2\">heading 2</h1><p> </p>","representation":"view","_expandable":{"content":"/rest/api/content/491524"}},"_expandable":{"editor":"","export_view":"","anonymous_export_view":"","storage":""}},"extensions":{"position":"none"},"_links":{"webui":"/pages/viewpage.action?pageId=491524","tinyui":"/x/BIAH","collection":"/rest/api/content","base":"http://localhost:8090","context":"","self":"http://localhost:8090/rest/api/content/491524"},"_expandable":{"history":"/rest/api/content/491524/history","container":"","ancestors":"","children":"/rest/api/content/491524/child","descendants":"/rest/api/content/491524/descendant","space":"/rest/api/space/SDFDS","version":"","metadata":""}}

      Actual behavior

      On Confluence 5.8.x and above, the same call does not return the contents.

      curl -u admin:admin http://localhost:8090/confluence/rest/api/content/1605634?expand=body.view
      curl -u admin:admin http://localhost:8090/confluence/rest/api/content/1605634?expand=body.view
      {"id":"1605634","type":"page","status":"current","title":"TOC/REST API test","body":{"view":{"value":"<p><div class=\"toc-macro client-side-toc-macro \" data-headerelements=\"H1,H2,H3,H4,H5,H6,H7\"></div></p><h1 id=\"TOC/RESTAPItest-heading1\">heading 1</h1><h1 id=\"TOC/RESTAPItest-heading2\">heading 2</h1><p> </p>","representation":"view","_expandable":{"content":"/rest/api/content/1605634"}},"_expandable":{"editor":"","export_view":"","storage":"","anonymous_export_view":""}},"extensions":{"position":"none"},"_links":{"webui":"/pages/viewpage.action?pageId=1605634","tinyui":"/x/AoAY","collection":"/rest/api/content","base":"http://localhost:8090/confluence","context":"/confluence","self":"http://localhost:8090/confluence/rest/api/content/1605634"},"_expandable":{"container":"","metadata":"","operations":"","children":"/rest/api/content/1605634/child","history":"/rest/api/content/1605634/history","ancestors":"","version":"","descendants":"/rest/api/content/1605634/descendant","space":"/rest/api/space/SOME"}}

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pkoczan Peter Koczan (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: