Is it possible to get attachments list from page macro via REST API?

Emila Lebiedowska December 7, 2020

I created a page that has a macro with attachments from another page.  I used this JSON to do it:

{
"type": "page",
"ancestors": [{"type": "page", "id": 11111111}],
"title": "Page Title 1",
"space": {"key": "KEY"},
"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=\"page\">\
<ac:link>\
<ri:page ri:content-title=\"Page/001\"/>\
</ac:link>\
</ac:parameter>\
<ac:parameter ac:name=\"sortOrder\">ascending</ac:parameter>\
<ac:parameter ac:name=\"upload\">true</ac:parameter> </ac:structured-macro>",
"representation": "storage",
}
},
}

On the browser, it works ok but is it possible to get a list of these attachments via REST API? When I'm using "Get macro body by macro ID" endpoint I'm getting only information about this macro like what's its name or parameters, but "body" is empty. How can I get any information about these attachments?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events