How Empty folder "Delete All" in outlook plugin

Viewed 31

Is there any way to manage folder to delete all items there? i want to clear trash folder "deleteditems" when i used EWS i got an error :

The requested web method is unavailable to this caller or application.

Is there any workaround to make it works in web plugin ?

full code here :

var xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \n' +
'               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" \n' +
'               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" \n' +
'               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\n' +
'  <soap:Header>' +
'    <t:RequestServerVersion Version="Exchange2010_SP1"/>' +
'  </soap:Header>' +
'  <soap:Body>' +
'     <m:EmptyFolder DeleteType="HardDelete" DeleteSubFolders="true">' +
'        <m:FolderIds>' +
'          <t:DistinguishedFolderId Id="deleteditems" />' +
'        </m:FolderIds>' +
'     </m:EmptyFolder>' +
'  </soap:Body>' +
'</soap:Envelope>';

Office.context.mailbox.makeEwsRequestAsync(xml, function (result) {
    console.log(result);
});
1 Answers

For Office.context.mailbox.makeEwsRequestAsync, we only support a small subset of EWS operations, all documented here. EmptyFolder is not one of the supported operations; that's why you are getting the error. An alternative approach is to use Microsoft Graph.

Related