Which one is better EWS API or EWS managed API? - exchangewebservices

I am developing email client for exchange server ....... I came across EWS and EWS Managed API. Please help me understand which one I should go for ?

If you are:
Using .Net and the functionality is implemented in the EWS Managed API....use the EWS Managed API.
Using .Net and the functionality is not implemented in the EWS Managed API....use the EWS Managed API to discover the EWS endpoint, and then code directly against EWS or use a proxy object model generator.
Using Java (not Android), use the EWS Java API. Note that this isn't actively updated, but you have access to the source.
For everything else, look to see if there are client implementations available. For example, you could evaluate IndependentSoft's client implementation (this is not an endorsement, this is just me giving an option). If not, you should implement Autodiscover and the EWS client.

Related

Use token from Outlook web add-in for EWS write operations

Is it possible to use any tokens from an Outlook add-in for use with authenticating EWS Managed API operations that create or update items?
Apparently the token returned from mailbox.getCallbackTokenAsync can only be used in read operations. I can indeed verify that is a problem because attempts to send emails or call UserConfiguration.Update result in an error:
The requested web method is unavailable to this caller or application.
I have been testing these methods from an ASP.NET Web API App Service in Azure, called from JavaScript in the Outlook add-in.
Apparently mailbox.getUserIdentityTokenAsync can be used to validate a user, but it is not clear if that can be used in conjunction with OAuthCredentials for ExchangeService.Credentials.
Are there any options here? I cannot ask the user for their username and password to authenticate with Exchange. I am certainly willing to use Graph or the Mail API, but AFAIK there are no ways to update user configuration items with those APIs.
You're looking for makeEwsRequestAsync(). Both CreateItem and UpdateItem operations are supported makeEwsRequestAsync.
You can find the full list of supported EWS operations in the documentation under EWS operations that add-ins support.
There is also support for calling into Microsoft Graph via the add-in but as you noted, Microsoft Graph supports a very limited number mailbox configuration options.

Using EWS SOAP requests in an Outlook web add-in

I need to use several EWS requests (e.g. GetUserConfiguration, UpdateUserConfiguration) that are not supported using Office.context.mailbox.makeEwsRequestAsync.
I cannot use the EWS Managed API in my own web service as a broker, and must use XML SOAP requests directly from the add-in's JavaScript (those methods are not available in the Graph or Mail APIs).
There are many examples (like this) showing how getUserIdentityTokenAsync can be used to pass that token to your web service (again, which I can't use) to use there in whatever way you need it.
However, I'm guessing the token retrieved from getUserIdentityTokenAsync is different and cannot be used. As a simple and hopefully appropriate test, I obtained an OAUTH token for my O365 account and used that as the token using SOAPe for a test GetUserConfiguration call and it worked. I then tried using the token from getUserIdentityTokenAsync and it didn't work (401 Unauthorized).
I concede that this may be a poor test, and I admit that at this point it is unclear to me how a SOAP EWS request from JavaScript in an Outlook dd-in can be authenticated without requiring an explicit user login (hopefully it can). And if it can, how do I get the token I need and how do I use it for this kind of client-side request?
You may want to use ews-javascript-api helper in this case. here is the example on how to use this with Outlook Add-ins.
https://github.com/gautamsi/ews-js-api-browser#working-with-plain-jsts-no-module-loadersbundlers
you may use any allowed api (available in makeEwsRequestAsync) with this library. with similar api what is available in Ews managed Api.

What is the differences between Office 365 APIs and EWS

What are the differences between Office 365 APIs and EWS (Exchange Web Services) ?
When do I use one or another?
Office365 API only works for Office365, while EWS works for any Exchange server from Exchange2007 up (including Office365). Other than that:
EWS is SOAP, Office365 API REST
EWS has a very nice/easy to use managed wrapper for .NET/Java
EWS has way more features - similar to using an Exchange client for Office365 compared to the webinterface. Things like Tasks are not in the Office365 API afaik.

How to search items across folders in office 365 using EWS Java API

I'm trying to search items across folders in office 365 using EWS Java API.
I'm using EWS Java API 1.3 version (https://github.com/OfficeDev/ews-java-api)
I have seen the following link and tried like that in Java but still this one also not working
Exchange Web Services (EWS) FindItems within All Folders
Regards
Ramesh
In 2013 and Office365 the best thing to use to search a Mailbox is eDiscovery which you can use from EWS http://msdn.microsoft.com/en-us/library/office/jj190897(v=exchg.150).aspx . There is nothing in the Java API to use the eDiscovery SOAP operations so you would need to either build those yourself or use raw SOAP or generate some proxyclass to use it.
Cheers
Glen

Exchange EWS: class "DistinguishedFolderIdType" not defined

I'm using Exchange web services, trying to create a calendar entry in another user's mailbox. My account in EWS has rights to do this, and I can successfully use Impersonation to create thes appointment in any mailbox.
However, some examples I've seen of doing this, use an instance of DistinguishedFolderIdType, not impersonation, to set the mailbox for the appointment.
Problem is, this class simply isn't appearing in my installation of the EWS SDK for Visual Studio. It's v1.1, obtained here, but can't be found in Object Explorer. What am I missing?
The type DistinguishedFolderIdType is not part of the EWS Managed API.
If you do not use the EWS Managed API but generate your own SOAP client proxy manually from Visual Studio by adding a reference to the EWS .asmx service, the generated proxy will contain DistinguishedFolderIdType.
However, depending on what you are trying to accomplish, you should be able to do it using the classes provided på EWS Managed API 1.1 and you won't need DistinguishedFolderIdType.