Unable to delete MS Graph Subscription - microsoft-graph-api

When using MS Graph Explorer, calling
GET https://graph.microsoft.com/v1.0/subscriptions/
returns i.e. two entries, with resource of user's onedrive root.
When I'm deleting one of those with
DELETE https://graph.microsoft.com/v1.0/subscriptions/{id}
I'm getting Status 204, but querying for all subscriptions, that deleted item is returned as well.
Trying to DELETE or GET that item again results in
{
"error": {
"code": "ResourceNotFound",
"message": "The object was not found.",
"innerError": {
"request-id": "b62bc766-c551-4460-a04d-2fa0a390283e",
"date": "2019-09-04T15:40:17"
}
}
}

My guess is that the GET operation is returning a cached (in the service) data set.
Unless you are still notification calls in your service, I would assume the DELETE worked, and the GET call will eventually not return removed subscriptions.

Related

"Unknown Error" in Microsoft Graph API Get Staff Availability in MS Bookings

When trying to make a request to the graph API endpoint for getting staff availability info on MS Bookings I keep receiving the below error which returns status code 500. I had followed the guide here and also decoded my access token and verified I had the right permissions.
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2022-07-25T08:21:46",
"request-id": "aa302590-9a6e-47a4-a5ac-51a12ef5e72e",
"client-request-id": "aa302590-9a6e-47a4-a5ac-51a12ef5e72e"
}
}
}
I also encountered the same error in graph explorer.
Well this seemed to work for me when I changed the timeZone value on the request payload from my local time zone to 'UTC'. So my request payload was changed as below
However same error persists on graph explorer - guessing its because application permissions are not currently supported on graph explorer

Microsoft Graph: Get delta on shared mail folder

If I (my.user#example.com = logged in user) try to get a delta on a mail folder another user (other.user#example.com) shares with me...
https://graph.microsoft.com/v1.0/users/other.user#example.com/mailFolders/OtherUsersInboxFolderId==/messages/microsoft.graph.delta?$filter=ReceivedDateTime%20ge%202021-04-01T08:00:00.0000000Z
... I get an ErrorItemNotFound:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"date": "2021-04-19T10:00:00",
"request-id": "<GUID>",
"client-request-id": "<GUID>"
}
}
}
If I do not request a delta but simply the messages in that folder, the request succeeds and returns the expected messages:
https://graph.microsoft.com/v1.0/users/other.user#example.com/mailFolders/OtherUsersInboxFolderId==/messages
If I (my.user#example.com) try to get a delta for the Inbox folder of a shared mailbox (shared#example.com), the request also succeeds:
https://graph.microsoft.com/v1.0/users/shared#example.com/mailFolders/SharedUsersInboxFolderId==/messages
https://learn.microsoft.com/en-us/microsoft-365/admin/email/create-a-shared-mailbox?view=o365-worldwide
So now my question is:
Why do deltas not work on folders another user shares with me?
Is it simply not implemented in the Graph API or am I doing something wrong?
Delta call is not supported on a shared mail folder and that is why you get 404.

Why are we suddenly getting 403 on graph calls to list a team's channels?

We do run the GET call:
https://graph.microsoft.com/v1.0/teams/711fc163-0408-4649-9a30-af65a5d30b52/channels
It used to return the channels just fine, but this week it suddenly starting failing with this error:
{
"error": {
"code": "AccessDenied",
"message": "Failed to execute Skype backend request GetThreadsS2SRequest.",
"innerError": {
"request-id": "226d8e17-fa0f-4c42-8139-4776e198a3b2",
"date": "2019-08-26T19:25:10"
}
}
}
We see that the problem is happening for different teams and across different tenants. This is critical!
Thanks for reporting this issue. There was an issue going on with List Channel Graph API which has been fixed now.

Unable to delete AppRoleAssignment using Beta Graph API

I'm using the Graph API beta endpoint to try and delete an AppRoleAssigmnet:
https://graph.microsoft.com/beta/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
109
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Direct queries to this resource type are not supported.",
"innerError": {
"request-id": "aa7c14a3-f700-4368-898e-009f1608ade1",
"date": "2019-04-30T00:29:50"
}
}
}
0
According to the beta documentation, this is allowed:
https://learn.microsoft.com/en-us/graph/api/approleassignment-delete?view=graph-rest-beta
I also verified the correct permissions according to the documentation as well.
I know this is a beta endpoint but any chance this will be fixed soon or do I need to use the Azure AD API instead?
UPDATE
I tried going through the users collection and it also fails:
https://graph.microsoft.com/beta/users/7e73da23-31d7-4eff-9a0b-05fcb15f5c9b/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
fb
{
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"request-id": "b6db0eee-dc45-4e10-a56c-9a870fb7315c",
"date": "2019-04-30T23:49:24"
}
}
}
0
I tried going through the service principal collection and it also fails:
https://graph.microsoft.com/beta/servicePrincipals/27e0a182-2008-4b4e-b998-731e0d111041/appRoleAssignments/I9pzftcx_06aCwX8sV9cmziqx-oiF21IlkxV9xRYvBM
I am using the DELETE verb and below is the response I get back:
18b
{
"error": {
"code": "BadRequest",
"message": "The type 'microsoft.graph.appRoleAssignment' does not inherit from and is not a base type of 'microsoft.graph.directoryObject'. The type of 'KeySegments' must be related to the Type of the EntitySet.",
"innerError": {
"request-id": "8c981e82-755e-4c25-b448-58d2b71e12c7",
"date": "2019-04-30T23:46:20"
}
}
}
0
I'm afraid this service bug has existed for a very long time. The only thing I can say is to try this with AAD Graph until this is fixed in Microsoft Graph. The schema unfortunately models appRoleAssignments as a standard relationship, whereas in fact it is implemented as a contained entity (i.e. you can only operate on the app role assignment when it is contained as part of another entity - like users, groups or servicePrincipals). The schema definition needs to be updated. The documentation is accurate IMHO.
Hope this helps

Microsoft Graph SharePoint access items (read/write)

I am attempting to create a new list item in SharePoint Online using the [beta] Microsoft Graph endpoint. The goal is to call Microsoft Graph from an Outlook Add-in but the problem persists on Postman.
When I call the endpoint as per the documentation I get the following error message:
{
"error": {
"code": "unauthenticated",
"message": "The caller is not authenticated.",
"innerError": {
"request-id": "bb094f39-71c9-4c7d-9d9b-913cc9622baf",
"date": "2017-08-08T11:32:02"
}
}
}
I'm using ADAL JS to fetch the authentication token and I initialized my AuthenticationContext with my tenantID. My app has the following permissions: offline_access, Sites.Read.All, Sites.ReadWrite.All, User.Read
2nd Edit - more details on readItem
I use the https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items endpoint with the {site-id} of my desired site from /sites and the {list-id} of the list from /sites/{site-id}/lists but this is the empty response I get:
{
"#odata.context": "https://graph.microsoft.com/...",
"value": []
}
If I try to to add /{item-id} to my original call to access specific item I receive this response:
{
"error": {
"code": "itemNotFound",
"message": "The specified list was not found",
"innerError": {
"request-id": "6e7ccae3-3aee-4dbb-ae3e-de61250478e0",
"date": "2017-08-09T13:13:33"
}
}
}
Which doesn't make sense because I can retrieve valid information about the list if i make the call without /items/..
Any and all input appreciated :) I'll gladly provide more code, this is all I deemed relevant and didn't want to overcrowd the post.
might be that you actually don't have an item with that id, since https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/1 works for me.
test the id's you really have by just https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items and each item returns it's id.

Resources