Microsoft Graph: Get delta on shared mail folder - microsoft-graph-api

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.

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

How to correctly move a mail folder from one mailbox to another?

I am trying to move folders from a user mailbox to a shared mailbox using
graphClient.Users[completedMailbox].MailFolders[folderID].Move(fPrincipalId).Request().PostAsync();
note: the above was working for many years until recently.
So I am wondering if something has changed as other people are experiencing the same, see my other post about the issue here but no resolution.
Microsoft QnA - Mailbox move in progress. Try again later., The user and the mailbox are in different Active Directory sites
In the link above you can see I have tied directly on the Graph API Explorer
POST https://graph.microsoft.com/v1.0/users/office#w*g.com/mailFolders/AAiSjAAA=/move
{
"destinationId": "AA*WyUAAA="
}
which returns
{
"error": {
"code": "ErrorMailboxMoveInProgress",
"message": "Mailbox move in progress. Try again later., The user and the mailbox are in different Active Directory sites.",
"innerError": {
"date": "2021-05-20T16:14:04",
"request-id": "c5f45ede-c5ad-40da-8528-bbafa91dede5",
"client-request-id": "***"
}
}
}
Thanks!

"Item not found" error is returned when i try to get file details that has been shared by the external user

Shared with me API provides me the list of all files and folders that are shared by internal and external users.
The Shared API URL is mentioned below
https://learn.microsoft.com/en-us/graph/api/drive-sharedwithme?view=graph-rest-1.0&tabs=http
But when I try to access the shared DriveItem resource of the file that has been shared by the external user bypassing DriveID and File ID into the API
/drives/{remoteItem-driveId}/items/{remoteItem-id}
The API throws an error as -
{
"error": {
"code": "itemNotFound",
"message": "Item not found",
"innerError": {
"date": "2020-10-20T12:07:39",
"request-id": "5a3b3836-fe3e-450a-837e-1b3e962ac94b",
"client-request-id": "5a3b3836-fe3e-450a-837e-1b3e962ac94b"
}
}
}
But the Same API works fine with the file shared with Internal Users.
Am I missing something here any help is greatly appreciated?
Regards,
Kuldeep K
For external tenants make sure you append ?allowexternal=true according to the public document and then give a try.
I had the same problem when trying to get workbook info from an excel made by a colleague. I was initially using
https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets
and fixed it using:
GET /drives/{remoteItem-driveId}/items/{remoteItem-id}/workbook/worksheets
The drive ID is under "parent reference" and in my case, the remote ID under "remoteItem" was the same as the first id listed.

Unable to delete MS Graph Subscription

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.

Can't get 'Inbox' folder via Microsoft Graph api

I can't get 'Inbox' mailFolder resource via Microsoft Graph api.
I tried to use /me/mailFolders to get all of mailFolders under the root folder, but the 'Inbox' didn't show in api response.
Besides, I also tried to send api with the well-known folder names, but the server responded ErrorItemNotFound.
However, there are many sub-folders under my 'Inbox' mail folder, and I can see them via Office365 website.
Here are the detail request and response.
Request:
GET /users/5df7dac4-5c93-4bb6-8dc9-7bdf586c3e97/mailFolders/inbox
Response:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"request-id": "7a5904ba-cf58-4278-aab4-937176ef2a45",
"date": "2019-01-21T08:23:22"
}
}
}

Resources