Closed sarea closed 2 years ago
Some more info: we have identified this is an issue with configuring IIS to allow CORS requests to the rest api url provided at Office.context.mailbox.restUrl
.
We cannot find any documentation on the side of OWA, nor on on the side of On Premise Exchange, how IIS is supposed to be configured to allow Add-Ins to request the Rest API. The only thing on the OfficeJs side, is this page, but the solutions provided their don't work for us.
(or, thinking out loud while I write, does JSONP as mentioned on that last page work for the REST API?)
OWA REST API is not supported on On-Prem. You will have to hit Hybrid endpoint to make it work, Or you can try using EWS API for your scenario.
Where can I find that in the documentation?
yes, Outlook add-in Javascript API requirement set 1.5 is supported in both Exchange 2019 and 2016 on-premise. But the Javascript API requirement set 1.5 supports calling REST API only for Online. Its a documentation miss and we will add an workitem in our backlog to update it. For REST API, check the documentation
Thanks for that explanation @exextoc.
You will have to hit Hybrid endpoint
How can an Add-In know if it has to hit that Hybrid endpoint or the regular REST API endpoint?
And wouldn't it make sense to set the url of the Hybrid endpoint on the Office.context.mailbox.restUrl
so Add-In can work seamlessly no matter their environment? Or would an OnPrem Exchange set up in Hybrid mode already do this?
@exextoc is using REST API in hybrid deployment already GA? As the documentation is updated May 2019 and mentions:
Note: The ability to use these REST APIs in hybrid deployments is currently in preview.
yes this ability is currently in preview, Can you try doing the REST call from server in onPrem.
@sarea
We would like to clarify few things on what we mentioned in earlier comments. Hybrid deployment is NOT a requirement for REST API to work.
For On-Premise case:
@exextoc any ideas on how to fix the CORS issue (enforced by browsers)? Is this something you can solve by changing certain settings in Internet Information Services (IIS) on Microsoft Server?
Regarding CORS issue, it is enforced by the browser. You can read more here.
As long as you try to hit REST APIs from the browser, it will throw the CORS issue. It is independent of where you have hosted your web files. Whether it is locally hosted using IIS or hosted on Microsft servers. You can find the reason behind it in the above URL.
The workaround suggested for the same was given in the previous response, REST token can be used from addin-backend and REST API is supposed to work in this case. You can try that and let us know if it works.
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.
yes, Outlook add-in Javascript API requirement set 1.5 is supported in both Exchange 2019 and 2016 on-premise. But the Javascript API requirement set 1.5 supports calling REST API only for Online. Its a documentation miss and we will add an workitem in our backlog to update it. For REST API, check the documentation
@exextoc is the documentation already updated or is there a way for us to track when this is done?
@exextoc what is meant by the "addin-backend"? I am running into this for a customer with an on-prem setup using an add-in in OWA. We are trying to figure out how to make the REST API calls work in OWA for that customer.
"Add-in backend" denotes "Addin-server" over here. We currently do not support REST calls in on-prem, and kindly use EWS calls. For more info, kindly check https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/use-rest-api#call-the-api
Thanks for the answer @exextoc. Are there any plans to add support for use of the REST API in an on-prem environment? Having to rely on SOAP/XML in 2021 is a bit cumbersome...
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
Currently the feature: REST API in an on-prem environment, you requested, is not a part of the product. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered when we go through our planning process.
Github Label: “Type: product feature request”
https://aka.ms/M365dev-suggestions
[Outlook Add-ins Engineering Team]
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.
I'm getting this error:
when fetching the message using OWA REST API As far as I know, using rest api is available since the add-in api 1.5, which has to be supported as it's mentioned this the documentation Is this a bug or On-Premises dose not support OWA rest api? if so do I need to do hybrid deployments? following this and this? knowing that in the first link it says in preview! Thanks
Environment
Exchange On-Premises 2019 CU4 Office api 1.5