Users can set their preferred date and time formats using Outlook on the web. Users can choose one of the supported short date or short time formats. This GET operation returns the format the user has chosen.
Users can set the time zone they prefer on any Outlook client, by choosing from the supported time zones that their administrator has set up for their mailbox server. The administrator can set up time zones in the Windows time zone format or Internet Assigned Numbers Authority (IANA) time zone (also known as Olson time zone) format. The Windows format is the default.
This GET operation returns the user's preferred time zone in the format that the administrator has set up. If you want that time zone to be in a specific format (Windows or IANA), you can first update the preferred time zone in that format as a mailbox setting. Subsequently you will be able to get the time zone in that format. Alternatively, you can manage the format conversion separately in your app.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
MailboxSettings.Read
MailboxSettings.ReadWrite
Delegated (personal Microsoft account)
MailboxSettings.Read
MailboxSettings.ReadWrite
Application
MailboxSettings.Read
MailboxSettings.ReadWrite
HTTP request
To get all the mailbox settings for a user:
HTTP
GET /me/mailboxSettings
GET /users/{id|userPrincipalName}/mailboxSettings
To get specific settings - only the automatic replies settings, date format, locale, time format, time zone, working hours, or user's recipient or mailbox type (for example, user purpose):
HTTP
GET /me/mailboxSettings/automaticRepliesSetting
GET /users/{id|userPrincipalName}/mailboxSettings/automaticRepliesSetting
GET /me/mailboxSettings/dateFormat
GET /users/{id|userPrincipalName}/mailboxSettings/dateFormat
GET /me/mailboxSettings/delegateMeetingMessageDeliveryOptions
GET /users/{id|userPrincipalName}/mailboxSettings/delegateMeetingMessageDeliveryOptions
GET /me/mailboxSettings/language
GET /users/{id|userPrincipalName}/mailboxSettings/language
GET /me/mailboxSettings/timeFormat
GET /users/{id|userPrincipalName}/mailboxSettings/timeFormat
GET /me/mailboxSettings/timeZone
GET /users/{id|userPrincipalName}/mailboxSettings/timeZone
GET /me/mailboxSettings/workingHours
GET /users/{id|userPrincipalName}/mailboxSettings/workingHours
GET /me/mailboxSettings/userPurpose
GET /users/{id|userPrincipalName}/mailboxSettings/userPurpose
Example 1: Get all mailbox settings of the signed-in user's mailbox
Get all the mailbox settings of the signed-in user's mailbox that include settings for automatic replies, date format, locale (language and country/region), time format, time zone, working hours, and user purpose.
GET https://graph.microsoft.com/v1.0/me/mailboxSettings
C#
// Code snippets are only available for the latest version. Current version is 5.x// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharpvar result = await graphClient.Me.MailboxSettings.GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*// Dependenciesimport (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mailboxSettings, err := graphClient.Me().MailboxSettings().Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MailboxSettings result = graphClient.me().mailboxSettings().get();
# Code snippets are only available for the latest version. Current version is 1.xfrom msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.me.mailbox_settings.get()
The following is an example of the response that includes only the automatic replies settings.
Note: The response object shown here might be shortened for readability.
HTTP
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Me/mailboxSettings/automaticRepliesSetting",
"status": "alwaysEnabled",
"externalAudience": "None",
"scheduledStartDateTime": {
"dateTime": "2016-03-19T02:00:00.0000000",
"timeZone": "UTC"
},
"scheduledEndDateTime": {
"dateTime": "2016-03-20T02:00:00.0000000",
"timeZone": "UTC"
},
"internalReplyMessage": "<html>\n<body>\n<p>I'm at our company'sworldwidereunionandwillrespondtoyourmessageassoonasIreturn.<br>\n</p></body>\n</html>\n",
"externalReplyMessage": "<html>\n<body>\n<p>I'm at the Contoso worldwide reunion and will respond to your message as soon as I return.<br>\n</p></body>\n</html>\n"
}
Example 3: Get specifically the working hour settings of the signed-in user's mailbox
The following is an example of the response that includes only the working hours settings. Notice that the user's work hours are in a custom time zone.
Note: The response object shown here might be shortened for readability.
Diğer geliştiriciler ve uzmanlarla gerçek dünyadaki kullanım örneklerini temel alan ölçeklenebilir yapay zeka çözümleri oluşturmak için toplantı serisine katılın.