microsoft-graph - Error: ResourceNotFound - Message: Resource could not be discovered - microsoft-graph-api

I've created a web app with Microsoft Graph API and it has been completed/tested and everything is working as expected. This web app is aimed to create calendar events for our Office 365 users. Right now there are a total of 9 users that calendar events are created for and two of them are having issues.
This is the specific response I get from Microsoft Graph API if I'm creating a calendar event for a user that is having issues:
Message:
{
"error": {
"code": "ResourceNotFound",
"message": "Resource could not be discovered.",
"innerError": {
"request-id": "4d6efba0-fce2-4abe-9f60-be3df8b55d6f",
"date": "2018-08-29T15:26:58"
}
}
}
I know that everything I'm doing is correct as the other seven users have no issues so the issue must be with the office 365 account its self. I've looked into account settings/permissions and everything I've checked is identical to a user that is working.
One of the biggest issues I'm facing with this problem is I don't understand the error its self. When it says "ResourceNotFound" my guess is that it's saying that it can't find the user account even though it does exist.
My question is what should be the next steps be in order to find a resolution? Should I see if I can recreate the mailboxes and transfer the email from the broken account to a new account? Or should I continue to try to find the root problem?

Related

Microsoft Graph API - General Exception during fetching Sites/root and drives

I created standalone application on node.js authorized in AAD with client/secret with permissions to access groups, sites, directories. I managed to create Teams group and team by Microsoft Graph API but when I tried to fetch sites/root or drives
https://graph.microsoft.com/v1.0/groups/{groupId}/sites/root
https://graph.microsoft.com/v1.0/groups/{groupId}/drive
I received 500 Internal Server Error:
{
"error": {
"code": "generalException",
"message": "An unspecified error has occurred.",
"innerError": {
"request-id": (....),
"date": "2020-01-31T09:15:17"
}
}
}
Is access to sites and drives possible by Graph API with app token?
the error is causing by using "Group.Create","Group.ReadWrite.All" together
Yes it is possible. One possibility here is that if you are attempting to access the drive or site right after creating the team, they may not be provisioned yet. There is some delay that can happen, typically only a few minutes at most.
When you register your Azure Active Directory App, which supported account type are you choosing?
I had exactly the same issue as you, but I've created a new Azure AD App and changed the supported Account type back to the first option and all worked accordingly.
I hope this could help your issue.
Thank you.

Planner tasks endpoint always returns a 403?

I'm attempting to get tasks assigned to a specific user from the Graph API, so based off of the sample query in the graph explorer i'm using this endpoint
https://graph.microsoft.com/v1.0/users/<user-email>/planner/tasks
Which works fine for whatever user I'm signed in as, but attempting to get tasks for a user I'm not signed in as will always return with a 403 and say I don't have the required permissions. Group.ReadWrite.All is granted by admin, and according to the graph docs, that should be fine, but no luck.
I've also just created a new demo tenant and one by one granted permissions in the graph explorer with admin and still no luck! So i'm doubting the issue really is permissions. And for the record I've tried v1.0 and beta endpoints, and I've attempted this in a SPFx Web Part, and it doesn't work in practice either.
Not sure that it will help, but this is what is being returned each time:
{
"error": {
"code": "",
"message": "You do not have the required permissions to access this item.",
"innerError": {
"request-id": "b02e3529-a4ae-4825-b4e6-7fc9b1fa228e",
"date": "2019-03-27T12:28:41"
}
}
}
Anyone else ran into this issue or know of a workaround?
Reading tasks for other people is not allowed. We are investigating app-only request support, which should enable this scenario.

Issue with calendar attachments in group event(s)

We have an issue accessing the attachment(s) of an event created in a O365 Group when using the Graph. The event is created in the group calendar, the group is set to public and can be accessed by the user requesting the event. Using the Graph Explorer we can access the event by using the following:
https://graph.microsoft.com/v1.0/groups/groupid/events/eventid
However using the: https://graph.microsoft.com/v1.0/groups/groupid/events/eventid/attachments results in a 403 error:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "af65c3ce-6f00-4137-817b-fa1a069d820e",
"date": "2018-08-06T09:02:26"
}
}
}
The issue can be replicated in either using the Graph Explorer or any other method. Obviously we have checked the permissions and Calendar.Read has been applied, but even after checking all permissions boxes available in the Graph Explorer (or AD App Registration) a 403 still occurs regardless of the selected permissions.
Any call to the attachment endpoint results in a success for events that are in a user’s calendar and it seems to be only occurring when retrieving events for a group. There seems no changes in behavior whether the group is public or private, nor using either the /beta or the /v1.0 endpoint.
The intellisense in the graph explorer does shows /attachment to be an option but always return a 403 when requested.
Any insights or tips on how to retrieve attachements for events created in a group would great.
I can reproduce your scenario from my end as well.
Tried using Graph Explorer, Console project and ASP.NET MVC (can download the sample from this link)
I have read through the attachment_get Microsoft document, however I can't find any API for your case. I presume there is no such function atm.
I recommend you to raise a ticket from your end to the OfficeDev.
PS: I had an unusual access is denied error when I tried to access group in ASP.NET MVC sample although I'm logged in with admin account, and it still shows access request is denied.
https://learn.microsoft.com/en-us/graph/api/resources/attachment?view=graph-rest-1.0
Events in group calendars do not support attachments.
Last year (an entire year after this question was asked) Microsoft finally clarified in the Graph docs that group events do not support attachments.

How to create an event into a group

I'm using Microsoft Graph API v1 with Administrator credentials via my software to create Events in a Group. However the response I get is a 403 with the following:
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "c4754c79-5e3a-4f63-9f88-404100513796",
"date": "2018-07-11T10:11:27"
}
}
}
on a POST request to https://graph.microsoft.com/v1.0/groups/{idGroup}/events/
I have checked all rights provided to the app via Azure AD and everything is fine (tokens, code and scope with Group.Read.All Group.ReadWrite.All). The Group is also created, the users are added to it and the owner is the admin I use for the create request.
I have also tried on the Microsoft Graph API Explorer but i have the same error.
Yesterday morning the creation was possible but I think some rights were corrupted. Is anybody has got this problem before? How to fix it?
After a few days without any changes in the code the problem dissapeared.
I am still not sure of what happened, anyway thanks guys !

Microsoft Graph API and shared calendar permissions

I'm using the Graph Explorer on developer.microsoft.com to query shared calendars.
Example:
https://graph.microsoft.com/v1.0/users/user#my.com/calendarview?startdatetime=2018-04-19T19:25:06.250Z&enddatetime=2018-04-26T19:25:06.250Z
This works fine on calendars where I have Reviewer or Full Details access. Calendars where I have Free/Busy, subject, location, I get a 404 and response like this:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"request-id": "9f9e950f-038e-4411-b813-10a76d4b94fa",
"date": "2018-04-19T19:42:48"
}
}
}
I can open the same calendar with my Outlook client no problem.
My question is, are all of the different permission levels that you see in the Outlook client not supported by Graph? Or is there something I'm doing wrong?
The permissions are consistent with Outlook and Exchange Web Services the difference is when you have "Free/Busy, subject, location" (or even one of the lesser) you only have rights to view the FreeBusy data of the Mailbox you don't have permissions to query the calendar directly which is what your trying to do so the error your receiving is consistent with that fact (and is what you would see in any of the other API's). Outlook (since 2007) uses the getuseravailability when querying the FreeBusy data for a user (which is where that right is valid) the equivalent in graph would be findMeetingTimes https://developer.microsoft.com/en-us/graph/docs/concepts/findmeetingtimes_example
https://graph.microsoft.com/v1.0/me/findMeetingTimes
(I don't think this is quite there on feature parity with EWS and Outlook on FreeBusy data though but its getting there)

Resources