Biagio Arobba
Biagio Arobba

Reputation: 1095

Get published Office 365 calendar JSON without OAuth2 step?

Edit:

Initially, the question was how to get an Office365 calendar in JSON without authentication; but, what I meant was how to get an Office365 calendar in JSON without requiring the OAuth2 step (so, for example on the server-side other authentication methods are acceptable to retrieve the calendar data).

Problem:

I would like to use the Office 365 REST API to access this published calendar (i.e. the "read" operation only since the calendar is published), so that I can "style" the calendar the way I prefer. So, I am looking for a public API approach to using one of my calendars. The code examples for the Office 365 REST API that I found use OAuth to authenticate the client. This seems like overkill.

I have come up with some possible solutions, so any suggestions on the best approach is welcome.

Background:

I have a published calendar in Office365, which gives me a feed:

http://outlook.office365.com/owa/calendar/USER@DOMAIN/CALENDAR_NAME/calendar.ics

and the URL:

http://outlook.office365.com/owa/calendar/USER@DOMAIN/CALENDAR_NAME/calendar.html

How can I do what "calendar.html" is doing, so that I can display a calendar the way I would like it to be displayed (instead of IFraming what Office365 provides)?

Example:

Here is an example URL using the REST API:

https://outlook.office365.com/api/v1.0/users/USER@DOMAIN/calendars

The browser will bring up a basic authentication dialog, so it looks like OAuth is not the only method required (one possible solution, the request could be proxied from a local server that is calling the REST API using basic authentication).

Issues:

Possible solutions:

Any suggestions on the best approach (or another approach not listed here) is welcome.

Upvotes: 2

Views: 2777

Answers (1)

Dorrene Brown
Dorrene Brown

Reputation: 619

The Office 365 APIs require Oauth2 in order to function. If you are using Visual Studio to develop your app, the O365 tools for Visual Studio + OWIN middleware will handle a lot of the oauth work for you.

If oauth is absolutely not an option, I'd consider using the EWS APIs instead, which can use basic authentication (more info on that here on MSDN).

Upvotes: 1

Related Questions