Cannot create new folder in Office365 calendar - microsoft-graph-api

When creating a folder in Office365 Outlook Calendar, We are getting the error as 'The Folder Already Exists', but we are not able to find such folder in the Office365 Calendar. We cross-checked for the folder with the same name in outlook web app and the client app but no folder exists with that name. Below are the API and the response.
POST https://graph.microsoft.com/v1.0/me/calendars HTTP/1.1
Request body: {"name":"New calendar"}
"error": {
"code": "ErrorFolderExists",
"message": "A folder with the specified name already exists.",
"innerError": {
"request-id": "c046eeba-f6f7-4b7e-98a3-b6a9a7055dd2",
"date": "2018-11-08T14:16:10"
}
}

You can query for the calendar name by using a filter
https://graph.microsoft.com/v1.0/me/calendars?$filter=name eq 'New calendar'
Then delete it using a delete request and the calendars' id
https://graph.microsoft.com/v1.0/me/calendars/<insert calendar_id here>

Related

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!

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.

Graph API GET "filesFolder" failing "Folder location for this channel is not ready yet, please try again later"

So after creating a channel in MS Team, I am making a graph API call -> GET /teams/{id}/channels/{id}/filesFolder
Because, I want the drive Id, for creation of folders inside the channel. But this API is failing
{
"error": {
"code": "NotFound",
"message": "Folder location for this channel is not ready yet, please try again later.",
"innerError": {
"date": "2021-03-22T13:01:23",
"request-id": "Not mentioning id here",
"client-request-id": "Not mentioning id here"
}
}
}
When you create a channel, it won't create a files folder in share-point. You need to go to channel and chick on files tab to create a files folder in share point. Teams create the files folder in share pint on Demand. This is by design. Could you please try going to channel in UI and redirecting to files tab and then check the folder using Graph API?

"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.

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