none
[E2013][EWS][Javascript]: EWS Portal Applications - example? Another way to get calendar info from a web application? RRS feed

  • Question

  • I need to query for conference room schedules from a single page web application. The server environment is hybrid (E2013, E2010, Exchange online) and the conference rooms are in an exchange 2013 server. I've read that I cannot use the Graph API and I cannot use the EWS SDK directly in a web app because the server does not support CORS.

    The EWS documentation mentions portal applications (https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/ews-application-types#bk_portalapps) which sound like they are doing exactly what I need, but I can't find any other information on it.

    Is there a way to accomplish this? Do I need to build a standalone app to get the data? Can I use the  Office 365 API / Outlook REST API?

    Thanks!

    Friday, July 12, 2019 2:24 PM

Answers

  • >>, I think what you're saying is that I can make the EWS calls in javascript in the browser  but route them through the reverse proxy to handle CORS. Is that correct?

    Yep that's correct the proxy will add the headers that will allows the browser to submit the request

     >>Is it possible to make the EWS calls in javascript? I found this package https://github.com/gautamsi/ews-javascript-api, but I don't know anything about it. My EWS requirements are very simple (just auth + free/busy for conference rooms).

    Sure the library works okay I've used that in the past as well , I found the documentation a little sparse I would suggest you try writing some code and if you run into issue post the code that doesn't work.

    Cheers
    Glen

    • Marked as answer by EASG Wednesday, July 17, 2019 1:36 AM
    Tuesday, July 16, 2019 10:37 PM

All replies

  • Because the Mailboxes are on Exchange 2013 then you won't be able to use anything other then either EWS or MAPI to access the Mailboxes (neither of these support CORS), simplest solution is just use a workaround like a reverse proxy https://www.npmjs.com/package/cors-anywhere which works for EWS (I"ve used this in the past). Another solution if you can get them to move the Mailboxes on Exchange 2016 with CU3 then you can configure it to be accessible using the Graph see https://docs.microsoft.com/en-us/graph/hybrid-rest-support

    Cheers
    Glen

     
    Sunday, July 14, 2019 9:46 PM
  • Glen,

    Thanks for your response. I will investigate having them move the mailboxes, since the graph API seems much easier to use. If I cannot, I think what you're saying is that I can make the EWS calls in javascript in the browser  but route them through the reverse proxy to handle CORS. Is that correct?

    Is it possible to make the EWS calls in javascript? I found this package https://github.com/gautamsi/ews-javascript-api, but I don't know anything about it. My EWS requirements are very simple (just auth + free/busy for conference rooms).

    I can see if I can have reverse proxy run on a server inside the firewall, since they are interested in keeping everything inside (the web app only needs to be accessible from within the firewall).

    I am new to Exchange development, so I appreciate the help. 

    Thanks,

    Elizabeth

    Monday, July 15, 2019 8:55 PM
  • >>, I think what you're saying is that I can make the EWS calls in javascript in the browser  but route them through the reverse proxy to handle CORS. Is that correct?

    Yep that's correct the proxy will add the headers that will allows the browser to submit the request

     >>Is it possible to make the EWS calls in javascript? I found this package https://github.com/gautamsi/ews-javascript-api, but I don't know anything about it. My EWS requirements are very simple (just auth + free/busy for conference rooms).

    Sure the library works okay I've used that in the past as well , I found the documentation a little sparse I would suggest you try writing some code and if you run into issue post the code that doesn't work.

    Cheers
    Glen

    • Marked as answer by EASG Wednesday, July 17, 2019 1:36 AM
    Tuesday, July 16, 2019 10:37 PM