The following code used to work
var graphResult = await graphClient.Users[email]
.Calendar
.Events
.Request()
.GetAsync();
Now, I get the following exception returned:
Code: ErrorItemNotFound
Message: The specified object was not found in the store.
Note:
I've recreated the issue using .NET Framework 4.8 as well as .NET Core
I am able to view, create, and edit the calendar using the Outlook Desktop application.
Using Microsoft.Identity.Client
Related
I am trying to retrive information about mails within a users mailbox.
I am using the following snippet of code:
graphClient.Users[mailbox]
.Messages[messageId]
.Request()
.GetAsync()
.Result;
Which works fine for the most requests.
The messageId is read previously from the graph API.
The app registration has the following permissions.
Found this: using microsoft graph api to read mail behalf of users in the enterprise -> I'm using the application login method.
MessageId's change when an item is moved between folders so it most likely that is the reason your having the problem. To solve it use the immutableid https://learn.microsoft.com/en-us/graph/outlook-immutable-id
I've written a program using the MS Graph REST API that sends a message to a channel with a file attached to the message using delegated permissions.
It works fine using my Office 365 account and have used it with a couple of customers without issue.
Using it at a new customer, I am getting the following error.
But, I am able to upload a file to the Channel Folder manually in the Teams App without issue.
Error:
Attempting to retrieve the Channel Folder for 19:ca8d4ccaaesdgsdfhsdaa40cc9e3b3677c75dc85f#thread.skype
Response Message: Not Found
Caught: java.lang.Exception: Failure getting the Channel Folder: {"error":{"code":"NotFound","message":"
https://mycustomer.sharepoint.com/db905278f90cd6f8c0b9e56bb0da6deb2c6a41cf312ab56b9d319b8c55252545ce3e407/978d84225552125552a37b5248a1926dd7fcf3cb7300a2fd01989ebdf009671400c250
Site isn't available. Attempting to create site : False.","innerError":{"date":"2021-05-28T21:48:31","request-id":"2752264b4d-2031-4d03-962e7-aeb1ccb4617a5","client-request-id":"2752264b4d-2031-4d03-962e7-aeb1ccb4617a5"}}}
java.lang.Exception: Failure getting the Channel Folder: {"error":{"code":"NotFound","message":https://mycustomer.sharepoint.com/db905278f90cd6f8c0b9e56bb0da6deb2c6a41cf312ab56b9d319b8c55252545ce3e407/978d84225552125552a37b5248a1926dd7fcf3cb7300a2fd01989ebdf009671400c250 Site isn't available. Attempting to create site : False.,"innerError":{"date":"2021-05-28T21:48:31","request-id":"27564b4d-2031-4d03-96e7-aeb1cb4617a5","client-request-id":"27564b4d-2031-4d03-96e7-aeb1cb4617a5"}}}
Code Snippet:
Request folderRequest = new Request.Builder()
.url("https://graph.microsoft.com/v1.0/teams/${teamId}/channels/${channelId}/filesFolder")
.method("GET", null)
.addHeader("Authorization", "Bearer ${token}")
.build();
Response response = client.newCall(folderRequest).execute();
println "Response Message: " + response.message();
This call fails with a 404 response when a new team/channel is created via the Graph API. This happens because the channel files folder is not created when creating a Team/Channel. By design unless the user initiate the file tab the graph API will throw the error.
The issue described above is resolved if a user clicks on the 'Files' tab. Post initialization, try again after sometime and observe result.
i have hundreds of users using my wpf app to download O365 messages (using c# Graph SDK), since some weeks small portions are having error on 1 or more mailboxes when downloading message.
The error returned by Graph sdk in c#:
ErrorInternalServerError Message: An internal server error occurred. The operation failed. ClientRequestId: 54e9e307-1a60-4f78-9f8f-5def1c6fb5b5
As i can't reproduce the problem on my side, it is very hard to find the problem, here some information:
A user can have 20 mailboxes and only 1 or 3 are no more working
The problem is only on downloading messages, the OAuth connection is working fine, i can get the list of folders, the number of messages in the folder,...
When the user deletes and re-create the email box in O365 it will work again
If the user connects with IMAP instead of Graph it works fine!
Here the code i use to download MIME message (which works fine since many months):
var _request = m_graphClient.Users[m_Account.Server_EmailAddress].Messages[pMessageID].Request().GetHttpRequestMessage();
_request.RequestUri = new Uri(_request.RequestUri.OriginalString + "/$value");
var _response = await m_graphClient.HttpProvider.SendAsync(_request);
With same result i tried also:
var _responseStream = await m_graphClient.Users[m_Account.Server_EmailAddress].Messages[pMessageID].Content.Request().GetAsync();
The problem sounds like there is an O365 mailbox update rolling, i have more and more users having this problem suddenly.
I hope you can guide me to find the problem.
Thank you very much.
We have built a feature on our project that utilizes the Graph API to retrieve all of the user's joined teams. The last time I know that this feature was working flawlessly was on Nov 3. Now I'm getting the following error when I tried to perform the query:
Code: AuthenticationError
Message: Error authenticating with resource.
The query is:
var teams = await _graphClient.Me.JoinedTeams
.Request()
.GetAsync();
We have other queries that utilize this graphClient and they work just fine, so I don't think there are any issues with my bearer token.
var user = await _graphClient.Users[userEmail]
.Request()
.GetAsync();
var userDetails = await graphClient.Me.Request().GetAsync();
We're getting close to deployment so I'm getting a bit nervous. Does anyone have any ideas?
Edit: We still have User.Read.All in our permissions.
The error is not a regular API response/error that returned for the above API call. So its tricky!!
Above error is telling that its failing due to authentication and it's related to compliant policies related to device, enrolled part of an organization.
Based on the suggestion, you validated, confirmed that the issue is
not happening with domain joined machine, but with the personal device which is not enrolled in the domain, nor it has the compliant policies.
When we query the shifts endpoint (in beta ver 0.7.0) with the following code:
var shifts = await graphClient.Teams[$"{this.teamId}"].Schedule.Shifts.Request().GetAsync();
We get the following exception
This was working ~40 days ago with the beta but now we get this error. We can query teams fine so we know the team ID is working but whenever we try to access shifts we get the above error.
Your client code is correct.
I was able to reproduce your error with Graph Explorer by trying to make the call with a user who hadn't consented to the Group.Read.All or Group.ReadWrite.All scopes.
Take a look at your access token using jwt.ms. Please add the missing scope to your application registration.