0

I'm trying to call Graph SDK to access the user's timezone. In order to do that i created a native app that has two scopes (Read and readWrite user's mailboxsettings). However as you can see in the image the timezone prop is null, despite the fact that i successfully grabbed the user's timezoneenter image description here.

This is the code that i did :

 public static async Task TryGetUserMailboxSettingsAsync()
        {
            var graphClient = AuthenticationHelper.GetAuthenticatedClient();
            User user = await graphClient.Me.Request().Select("MailboxSettings").GetAsync();
            MailboxSettings mailboxSettings = user.MailboxSettings;
        }

Can anyone tell me why ?

enter image description here

Soufien Hajji
  • 477
  • 1
  • 8
  • 24

1 Answers1

0

According to your description, I assume you want to get the timezone property using the Graph SDK.

First, we should set the mail setting at here. Then we can find the area of your app settings and find the Mail. Click it and set the timezone and the language.

Then, we use the code like you posted, the timezone property will not be null.

Darrel Miller
  • 139,164
  • 32
  • 194
  • 243
Keen Jin
  • 1,060
  • 1
  • 6
  • 8