Microsoft Adds CORS Support to Aid JavaScript Development

Microsoft recently announced that the OneDrive for Business and Sites APIs now support cross-origin Resource sharing (CORS). The new functionality enables JavaScript developers to interact with Office 365 APIs. In addition to OneDrive and Sites, MailCalendar and Contacts are next in line for CORS support. The release means that developers can call Office 365 APIs from both the server and client sides.

"As we have said in the past, we are listening on all the channels we encourage you to participate on (UserVoiceYammerStackOverflowTwitter)," Jeremy Thake, Office 365 product marketing manager, said in a blog post. "CORS support for the Office 365 APIs was taken as a high priority based on this feedback and we appreciate the communities support in providing the justifications for this. We encourage you to continue to provide this feedback for future feature requests."

Client-side calls result in developers writing single-page applications that interact with Office 365 APIs. Calls no longer need to proxy through a server-side service. Microsoft anticipates the offering will lead to a better User Experience and better performance. CORS support enables Web clients to request Back-end resources from other Web clients in an entirely different domain.

To help developers get started, Microsoft published documentation specifically on CORS support. Available Documentation also includes code samples and a series of hands-on labs for building apps. One example Microsoft provided, the Expense Manager, was originally written in ASP.NET (server side) but has now been completely refactored from the client side. This example gives developers an example of a complete transition and the corresponding benefits.

Microsoft made a ADAL.JS Library generally available last month. The library allowed CORS support for Office 365. Microsoft says it will continue to listen to its developer and partner community as it provides new and simplified access to its vast product offering. Client-side (JavaScript) accessibility to software and services has gone hand in hand with the growth of the API economy. Microsoft's move was timely, and we should expect more of the same in the future. Microsoft already hinted that as more Office 365 endpoints arise, additional services will be supported in a similar manner (e.g., Office Graph, Yammer, Video Portal, Skype).

Be sure to read the next API Strategy article: Eventbrite Exposes RESTful APIs to Improve Attendee Experience