I want to create a web application, using html and JS, and I will be accessing EWS managed API. So can we access EWS API via javascript or any other language? If yes how to do so?
-
Have a similar problem at the time. Maybe you can find something useful in my questions: [here](http://stackoverflow.com/questions/17927008/get-unread-emails-from-exchange-in-windows-8-store-app), [here](http://stackoverflow.com/questions/18011110/passing-user-from-windows-store-app-through-wcf-service-to-exchange-web-services) – Martin Sep 05 '13 at 06:30
2 Answers
If anyone still looking for JavaScript version, I am author of ews-javascript-api
at https://github.com/gautamsi/ews-javascript-api, this is functional and have many operations supported. mostly most common calls. open issue at GitHub for anything not implemented I usually take next weekend to publish that feature in npm if not complex.
Published as npm ews-javascript-api
Due to Exchange CAS server CORS limitation (HTTP OPTIONS verb not implemented) you can not use it in browser. Node.js works fine. You can also use it in Electron (Atom Shell) or in NW.JS (Node-WebKit)
Support Office 365 and on-prem Exchange, all version supported by ews-managed-api (official repo).
Supported Authentication mechanism:
- Basic (provide HTTPS url when calling)
- Kerberos (with provided sample link in readme)
- Cookies with ISA/TMG (with provided sample link in readme)

- 1,028
- 1
- 9
- 13
-
-
yes you can, see the example at https://gist.github.com/gautamsi/ba0561da1b4a2b29478943ba5f002328 I tried to paste example in comment but it exceeded the character limit. – Gautam Singh Nov 12 '16 at 15:14
-
you do not need to do @types installation it is not registered with TSD. You can install ews-javascript-api@next (beta version with more fixes + promise improvements). TypeScript will recognize package.json typings details. npm package includes typing. – Gautam Singh Jan 31 '17 at 16:06
-
When you say it can't be used in a browser, does that mean it can't be used in an Outlook web add-in? – Eric Legault Sep 08 '17 at 03:15
-
you can now use this in browser based process like Ionic, Cordova, Oulook web add-in etc (CORS must be disabled,more info at github). checkout [`ews-js-api-browser`](https://github.com/gautamsi/ews-js-api-browser) – Gautam Singh Sep 09 '17 at 06:48
-
@GautamSingh Is there a way to configure exchange server to disable CORS?. I'm using your library for web app running on browser. Right now i'm using plugin to disable CORS. Any help much appreciated. Thanks! – user505593 Sep 21 '17 at 18:31
-
@user505593 not to my knowledge. you do not want to enable this on Exchange server and open all type of other attack surface. unless Microsoft supports this, you should stay away. what is your application use case? you may want to use it with Electron or NW.js – Gautam Singh Sep 22 '17 at 22:14
-
@GautamSingh Thanks for your reply. I trying to build Web client similar to Outlook Web App. – user505593 Oct 11 '17 at 06:41
-
if it is purely browser based and you do not want to save credential on server, you can create a proxy (authenticated) on server which will proxy the http calls to Exchange. you do not have to run ews code on server just proxy the request to bypass CORS. – Gautam Singh Oct 11 '17 at 18:47
The EWS Managed API is a .NET wrapper around the EWS API (SOAP and POX Web Services).
If you're using a .NET language such as C# then you should use the EWS Managed API on the server-side and create your own JSON services (I recommend ASP.NET Web API) for your client-side JavaScript to call.
If you're only using JavaScript, you may be able to use node-soap to call the EWS SOAP services.

- 3,237
- 1
- 29
- 37