I am trying to get both personal calendar and shared calendar in an office 365 account using RESTapi. Since currently Oauth2 doesn't support accessing shared calendar, I'm testing my code with basic authorization.
I have three calendars in my account:
- [email protected](own calendar)
- [email protected](shared calendar)
- [email protected](shared calendar)
Using following end points I was able to get events using basic authorization:
https://outlook.office365.com/ews/odata/Users('[email protected]')/Events
The strange part is for the past two days I'm not able to get events for [email protected] and [email protected] using the same end point. I get the following error when I try to access the events:
{"@odata.context":"https://outlook.office365.com/ews/odata/$metadata#Users('[email protected]')/Events","value":[{"error":{"code":"ErrorInternalServerError","message":"Object reference not set to an instance of an object."}}
But I can still access events for [email protected] using same endpoint and basic authentication.
I also tried to access own calendar using oauth2. I get similar error
{"value":[{"error":{"code":"ErrorInternalServerError","message":"Object reference not set to an instance of an object."}}
But I can successfully talk to calendar endpoint
I was wondering if anyone had seen this error before. Any help/suggestions are greatly appreciated.