I am trying to add a preview of an attached file to a page through confluence API with view file macro. It works fine but the title of the preview is some random Id. When I add a preview through web it shows the file name as the title of the attachment preview. I can't find the documentation to set this preview title. The left one in the image is added through API and the right one through web.
This is the call to upload the attachment
curl -v -S --header 'Authorization: Basic ${token}' -X POST -H "X-Atlassian-Token: no-check" -F "file=@filePath" https://abc.atlassian.net/wiki/rest/api/content/${PageId}/child/attachmentThis is the page content
<p class="media-group">
<ac:structured-macro ac:name="view-file" ac:schema-version="1" ac:macro-id="8470d36e-7035-4ee4-9ea5-d8a3fc87b843">
<ac:parameter ac:name="name">
<ri:attachment ri:filename="' + fileName + '" ri:version-at-save="1" />
</ac:parameter>
</ac:structured-macro>
</p>
This is the JSON body
{
"type": "page",
"title": "pageTitle",
"version": {
"number": 2
},
"body": {
"storage": {
"value": "${content}",
"representation": "storage"
}
}
}This is the call to the API to update page content
curl -H 'Authorization: Basic ${token}' -H 'Content-Type: application/json' -X PUT -d'@requestBody' https://abc.atlassian.net/wiki/rest/api/content/${PageId}?expand=body.storage
