makeEwsRequestAsync fails to work in Outlook 2016 for Windows - outlook

I was trying to develop a sample Outlook add-in with the Office JS API.
The add-in has the following setup:
Exchange 2016
Read/Write Mailbox permissions
OAuthAuthentication set to true on the Client Access Server EWS directory
With this, I'm able to make makeEwsRequestAsync calls to EWS from Outlook Web Access.
However, with Outlook 2016 for Windows, the requests to EWS fail.
Using Fiddler, I see some HTTPS 401 Unauthorized responses:
POST https://ad12exch16.latveria.lab.proofpoint.com/EWS/exchange.asmx HTTP/1.1
The getUserIdentityTokenAsync method does work though.
Any ideas on how to solve this problem?

Related

Can Microsoft Outlook Policy Tips be used in conjunction with add-ins REST/EWS send API?

I have a scenario where a "compose mode" add-in for Outlook makes a subject line update to the draft email, then sends the email. The send action is currently carried out using either the EWS or REST APIs.
The issue occurs when a "override" policy tip is configured by the Exchange admin. The policy tip in question requires the user to choose override, in certain cases, to send an email (e.g external communication).
During message composition, if the appropriate trigger for the policy tip occurs, the policy tip appears and offers the user the option to override (as expected). When the add-in action is called, via ribbon button, the email appears to be sent. However, moments later an automated message from the Exchange indicates that the email has not been sent due to not adhering to the policy rule.
I believe this occurs because the send API, for both EWS and REST, does not call a local function in the Outlook client. Rather these API actually perform the send event on an email item syncedto and stored on the server. The Exchange server has no knowledge of the user's selection to override the policy tip at the client, so the issue occurs.
This happens in both Outlook on Desktop and Outlook Web Access.
I have searched through the EWS and REST APIs and cannot find any way to share/indicate the policy tip override when using these API.
I have searched the add-ins developer documentation and can find no mention of policy tips at all.
I have searched the Exchange admin policy tips documentation and can find no mention of add-ins compatibility or add-in related behavior.
So, can Microsoft Outlook Policy Tips be used in conjunction with add-ins REST/EWS send API?

Is there an Outlook Javascript API to get control to addin on Saving as Draft or before syncing to server?

I am working on an Outlook addin to make sure confidential information is not leaked using mail.
Using the on-send feature using ItemSend, we were able to get the email fields and block the sendmail, if required
https://github.com/OfficeDev/Outlook-Add-in-On-Send/tree/master/outlook-add-in-on-send
But there is an use case
User composes the mail and saves it to draft (without clicking on Send)
In outlook on web, composing a mail saves to draft automatically.
How can the add-in get a callback when draft is synced to Outlook server ?
How can the add-in get a callback when draft is synced to Outlook server ?
There is no such callback available for web add-ins. You may post a feature request or suggest a feature on the Tech Community site where community members get to share ideas on ways MS can make Microsoft Graph and Office Platform better by sharing feature requests and ideas.
Nothing like that for the JS-based addins.
For the COM addins, OOM exposes MailItem.Write event - your event handler can cancel the operation.

Error on Outlook Add-In with encrypted mails

I developed an Outlook Add-In that represents an html page with some JavaScript.
When I try to open the Add-in reading/writing an encrypted mail on our company's tenant, an error message appears.
"You cannot perform this action. Permission to this message is restricted"
The same Add-In works on my test tenant with encrypted mails.
I assume it's because of different Outlook versions (version 2002 on my business tenant vs version 2008 on my test tenant) or some special settings in the tenant.
This post Can't access email with digital signature in outlook addin? Microsoft explained that SMIME signed emails are supported but encrypted are not. But the post is almost 3 years old and as I said, it works with my test tenant.
For Outlook Win32, add-ins on encrypted mails are only supported on builds >= 13229.10000, see here for reference:https://learn.microsoft.com/en-us/office/dev/add-ins/reference/objectmodel/preview-requirement-set/outlook-requirement-set-preview#add-in-activation-on-items-protected-by-information-rights-management-irm

Exchange ErrorInvalidClientAccessTokenRequest

I built an Outlook Add-in and it uses a token to download email attachments from the Exchange server.
On my O365 developer account, it successfully retrieves the token.
The Add-in has been deployed to the client's Outlook but when they try to retrieve the token, this is the response message:
MessageText:"The token for this extension could not be retrieved.
"ResponseClass:"Error"
ResponseCode:"ErrorInvalidClientAccessTokenRequest"
Token:null
__type:"GetClientAccessTokenResponseMessage:#Exchange"
The code is exactly the same and so is the request. Is there any clues I could look into to figure out what about their environment would cause this to fail?
The ErrorInvalidClientAccessTokenRequest field is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013.

Office365 list contacts using EWS returns The remote server returned an error: (403) Forbidden

I have build a C# application using Exchange Web Services to read Outlook Contact data from Office 365. Until April 2013, this was working just fine. However, Office 365 has been updated. Now, when I query contact data I receive an Exception "The remote server returned an error: (403) Forbidden."
I read some info about SharePoint Online App authentication, but can't find any details on MSDN. Is anyone familiar with this?

Resources