Forum Discussion
UnknownError (503) when calling Graph API's /calendar/events for some users
Hi, when using the /calendar/events API, it returns "Unknown Error" for some users, but works OK for others. It reproduces consistently for at least 2 months.
Example request:
GET https://graph.microsoft.com/v1.0/users/07f20085-cd3e-4532-a59e-b454de5b62ea/calendar/events?$select=id&$top=1
Authorization: Bearer %token%
And we get the following response (the message is abbreviated for brevity):
"error": {
"code": "UnknownError",
"message": "<html>\r\n<head>\r\n\t<meta charset=\"utf-8\">\r\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\r\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=yes\" />\r\n\t<title>Service Unavailable</title> <..>",
"innerError": {
"date": "2022-01-10T20:24:26",
"request-id": "ce045d30-8f55-43ee-bddf-25d11f0766a6",
"client-request-id": "ce045d30-8f55-43ee-bddf-25d11f0766a6"
}
}
The error message is unfortunately unhelpful: there're no details as to what is wrong.
What we did:
1) Made sure the user has a cloud solution (i.e. not on-premises)
2) Asked the organization's admin to check if there's any difference between users for which the API works and for which the API doesn't; apparently, nothing suspect found
What can be the cause of this "UnknownError" response? Is this a bug on the Teams side, or is it a misconfiguration in the affected organization? Maybe there's some permissions that we're missing (even though it works OK for other orgs)? We're out of ideas.
- Sayali-MSFTMicrosoftkgeyst- We are looking into this I will get back to you soon.
- Sayali-MSFTMicrosoft
kgeyst - We are tried to repro the scenario, but unable to repro. Could you please check it once permissions?
Get event - Microsoft Graph v1.0 | Microsoft DocsThanks,
Sayali
------------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
- Sayali-MSFTMicrosoftkgeyst - Could you please confirm if your issue has resolved or still looking for any help?
- kgeystCopper Contributor
I decoded the generated JWT access token and it has the following roles:
"roles": [ "OnlineMeetings.ReadWrite.All", "CallRecords.Read.All", "User.Read.All", "Calendars.ReadWrite" ],
The same token works fine for another user.
- Sayali-MSFTMicrosoft
kgeyst -As per document, you need to add the both permission.
Calendars.Read, Calendars.ReadWrite.Could you please add it and check it once?
Let us know if you have any query.
Ref. Doc:-List events - Microsoft Graph v1.0 | Microsoft Docs