How do you insert a confluence macro into a page created by the Confluence Rest Api?

后端 未结 1 1345
孤独总比滥情好
孤独总比滥情好 2021-02-18 17:43

I\'ve successfully used the Confluence Rest API to create a page and attach it to a Space. MY json looks much like that from the example:

{
\"type\":\"page\",\"t         


        
相关标签:
1条回答
  • 2021-02-18 18:43

    As luck would have it, after I posted this question I stumbled on the answer. So for the benefit of others, here is what I found.

    This page provided the missing pieces: Confluence Attachment Macro Help

    My JSON looked like this:

    {
    "type":"page",
    "ancestors":
        [
            {
                "type":"page",
                "id":12355342
            }
        ],
    "title":"Page Title 1",
    "space":
        {
            "key":"DAT"
        },
    "body":
        {
            "storage":
                {
                    "value":"<ac:structured-macro ac:name=\"attachments\">
                    <ac:parameter ac:name=\"old\">false<\/ac:parameter> <ac:parameter ac:name=\"patterns\">*<\/ac:parameter> 
                    <ac:parameter ac:name=\"sortBy\">name<\/ac:parameter> <ac:parameter ac:name=\"sortOrder\">ascending<\/ac:parameter> 
                    <ac:parameter ac:name=\"labels\"><\/ac:parameter> <ac:parameter ac:name=\"upload\">false<\/ac:parameter> <\/ac:structured-macro>",
                    "representation":"storage"
                }
        }
    }
    
    0 讨论(0)
提交回复
热议问题