-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support User.MailboxSettings with only MailboxSettings.Read #538
Comments
Marked your initial concern as a service issue which we will discuss with service owner a bit later today. We are aware that our generated library doesn't provide navigation to the mailboxsettings resource. We have plans to provide a generic way to address this issue. Adding a partial for IUserRequestBuilder for Mailboxsettings would provide the functionality to access MailboxSettings. That would require a few other files as well. |
Please also add a possibility to only load specific properties of the mailbox settings. E.g. by directly using the endpoint for the mailboxsettings language: GET https://graph.microsoft.com/v1.0/me/mailboxSettings/language as described here. |
@matt-sullivan As an interim measure, the UserSettings resource has been added to the community library. |
Here's how you can use the SDK in its current state to get mailboxsettings. async Task GetMailboxSettings(GraphServiceClient client)
{
var mailboxSettingsUrl = client.Users["adelev@contoso.onmicrosoft.com"].RequestUrl + "/mailboxsettings";
HttpRequestMessage hrm = new HttpRequestMessage(HttpMethod.Get, mailboxSettingsUrl);
await client.AuthenticationProvider.AuthenticateRequestAsync(hrm);
HttpResponseMessage response = await client.HttpProvider.SendAsync(hrm);
if (response.IsSuccessStatusCode)
{
// Deserialize into MailboxSettings object.
var content = await response.Content.ReadAsStringAsync();
MailboxSettings mailboxSettings = client.HttpProvider.Serializer.DeserializeObject<MailboxSettings>(content);
}
} You can append individual settings to the end of mailboxSettingsUrl. You will need to change the deserializaton target. |
I've been following this thread because I was experiencing the same issue but today I discovered it is working and I can get the MailboxSettings with just MailboxSettings.Read. Was there any update that resolved this? |
This was fixed silently on the API side. Closing this as it is now resolved. |
There is currently no .Net way to read users' MailboxSettings with only (Application) MailboxSettings.Read permissions.
client.Users[id].Request().Select("MailboxSettings").GetAsync()
calls https://graph.microsoft.com/v1.0/users/xxx?$select=mailboxSettings
and gets an access denied error. This seems like a bug in the graph service, but I'm not sure of that and not sure where to report it.
It is possible to query https://graph.microsoft.com/v1.0/users/xxx/mailboxSettings with only those permissions, however I don't think this library has any way to query that url.
Should a MailboxSettings property be added to IUserRequestBuilder?
https://stackoverflow.com/questions/54750940/access-denied-when-trying-to-get-my-mailboxsettings-using-select-with-mailboxset relates to this issue.
AB#7299
The text was updated successfully, but these errors were encountered: