**Note** Office365 supports REST by default; it wasn't until Exchange 2016 CU3 that it was available for on-prem (go figure).
You can find the details here:
https://blogs.technet.microsoft.com/exchange/2016/09/26/on-premises-architectural-requirements-for-the-rest-api/
If you're running on-prem, you should be patched up way beyond CU3, right?
The issue is: REST API is enabled on Exchange 2016 CU3+ but if you run a load balancer, like Kemp's super-awesome Load Master, the API won't be published out of the box.
By default, the Kemp Exchange templates don't enable Exchange API to be published. As a workaround, you can enable the "default" content rule on your SubVSs, but some IT security departments won't like that, because it's a blanket rule.
What we'll do instead, is create a Custom Content Rule, and apply it to our OWA SubVSs ('Sub-Virtual Services), which will allow the API to be published.
Create The Rule:
In your Load Master WUI, go to Rules & Checking > Content Rules > Create New Rule:
Give it a name like "REST_API"
Rule type: leave as default (Content Matching)
Match type: leave as default (Regular Expression)
Match string: type in the following:
/^\/api.*/
Tick Ignore Case
Click Create Rule:
Your new rule will be listed:
Adding The New Rule:
Next, we'll add our new content rule to our OWA SubVSs
Navigate to Virtual Services > View/Modify Services
Click Modify next to your Internal Service:
**Note** You can modify your external service if you want; it would just depend on your security requirements. For instance, our IT Security Department doesn't understand Exchange and therefore won't allow me to publish OWA externally, so I can only publish the API internally as well.
Expand SubVSs, and click the Rules button next to OWA:
In the drop-down, select our new "API_REST" rule and click Add:
You'll now see the API_REST rule listed for the OWA rule set:
Testing The New Rule:
In a web browser navigate to your Exchange namespace with the API URL at the end, like so:
You will be presented with a Save/Open JSON prompt:
Open in Notepad, and you'll see your messages in your mailbox:
Now your on-premises Exchange API REST/OData is published, and the app (or whatever needs that service) can hit it!
No comments:
Post a Comment