ResourceNotFound error while trying to reach outlook calendar using ms-graph.

parth 31 Reputation points
2022-08-23T21:24:26.667+00:00

I am following this tutorial https://github.com/Azure-Samples/ms-identity-msal-java-samples/tree/main/4.%20Spring%20Framework%20Web%20App%20Tutorial/2-Authorization-I/call-graph and as expected same is working fine. For proof of concept purposes, I added another endpoint in the same Java Spring app and tried to reach the calendar with something similar like this :

GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();

CalendarCollectionPage calendars = graphClient.me().calendars()
.buildRequest()
.get();

Same is leading to com.microsoft.graph.http.GraphServiceException: Error code: ResourceNotFound Error message: Resource could not be discovered. Rather I am getting null as calendars reference variable.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,376 Reputation points
    2022-08-24T10:17:44.117+00:00

    Hi @parth

    It looks like your users don't have Exchange Online mailboxes, make sure you have created Exchange Online mailboxes for your users before calling the api endpoint. Or assign an Exchange Online license to your user account, which will automatically create a mailbox for the user.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.