We develop an Outlook Add-In using the office JavaScript api and need to Update a category for a mail message.
When trying to call UpdateItem with Exchange EWS, using the add-in token - it fails with 500.
See request and response at: http://pastebin.com/55x2d2Ht
- The app's manifest permissions is ReadWriteMailbox (highest)
- When the app is selected in OWA /manageapps - it displays "When this adding is clicked, it will be able to: Read, create and update email in your mailbox"
- Tried both token from mailbox.getCallbackTokenAsync and using makeEwsRequestAsync.
- EWS GetItem and CreateItem operations succeeds - it is only UpdateItem that is failing
- Response to UpdateItem: 500 The requested web method is unavailable to this caller or application.
- The fact that it is 500 (and not 403) may imply that the UpdateItem operation is blocked for addin app altogether
- The jwt token (from getCallbackTokenAsync) doesn't have 'scp' key
- If the same UpdateItem XML Soap packet is sent with another token, from a test OAuth app registered in Azure with permissions Read/Write to Exchange --> it succeeds. This app jwt token with "scp": "full_access_as_user Mail.Read Mail.ReadWrite Mail.Send"
- Tried with another exchange user with the add-in token - also fails.
- Office AddIn docs states that EWS UpdateItem operation is supported in the context of addin. See Office Dev Center
- Summary: Only Ews UpdateItem with the Addin OAuth token fails. Other operations succeeds and Posting UpdateItem using other tokens (or Basic Auth) also succeeds.