question

SomitMitra-7548 avatar image
0 Votes"
SomitMitra-7548 asked SomitMitra-7548 commented

Graph-API GET /users/{id | userPrincipalName}/calendars

Can't access all calendars for my users

Trying with Graph Explorer
[https://graph.microsoft.com/v1.0/me/calendars] just works fine and gives me the colanders.

Whereas [ https://graph.microsoft.com/v1.0/users/UPAN/calendars ] always giving 404 status code
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",

But when the user opened his calendar, he was able to see all three calendars from his Outlook.

Need help

microsoft-graph-calendarmicrosoft-graph-calendar-places
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShwetaChoudhary-8869 avatar image
1 Vote"
ShwetaChoudhary-8869 answered SomitMitra-7548 commented

Thank you for reaching out.

Couple of things to check here -
1. When you are trying to get users' calendar, you are using user id or userPrincipalName properly in your Get request.
2. Make sure you have the necessary permission to call this API. Refer documentation here for this.
3. Check your access token on https://jwt.ms and see if your token has all the necessary scopes.

If you are still facing issues, please share your client-request-id and timestamp so that we can look into it.

Thanks.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ShwetaChoudhary-8869 Thanks for your time on reviewing my query ,

  • I've checked the token in jwt.ms, it seems it has all the necessary token permission inside the "scp" property.

  • The UPN I'm using is cross checked and I confirm it's correct.

  • I had given Delegated type permission from AAD, therefor I'm creating a Delegated user type token to hit the Graph API.

  • In my lab I did try today by giving also Application type permission in AAD for the same APP with all required Calendar permissions. Now when I see token in JWT.ms I see permissions are there in "roles" and the Graph API call returns me the expected result and I can see all the calendars for the UPN.

Now, if I may ask you, is that we need to have only App type token to see users calendar ?









0 Votes 0 ·