I have an Outlook web addin which can be used in the compose window. What the addin does is, send a request to our server with the ID of the selected file to attach (Our server is a file storage system. The user will be able to select a file and attach it to the new email). The server will prepare the file and use the Outlook Rest API to attach the file to the email: https://docs.microsoft.com/en-us/previous-versions/office/office-365-api/api/version-2.0/complex-types-for-mail-contacts-calendar#referenceattachment
Sample request body:
{
"@odata.type": "#Microsoft.OutlookServices.ReferenceAttachment",
"Name": "Iglue picture",
"SourceUrl": "https://i.imgur.com/rNIYuhi.jpg",
"ProviderType": "Other",
"Permission": "Edit",
"IsFolder": "False"
}
Now the file gets attached successfully. But the problem is, the user have to reload Outlook to see the attached file. So my question is how to attach the file and trigger a refresh just like the Office JS API's Office.context.mailbox.item.addFileAttachmentAsync
method?