ユーザーのメールボックスの設定を取得する

名前空間: microsoft.graph

ユーザーの mailboxSettings を取得します。 すべてのメールボックス設定を表示することも、特定の設定を取得することもできます。

ユーザーは、Outlook クライアントを介してメールボックスに以下の設定を行うことができます。

ユーザーは Outlook on the web を使用して、好みの日付と時刻の形式を設定できます。 ユーザーは、サポートされている日付 (S) または時刻 (S) 形式のいずれかを選択できます。 このGET操作は、ユーザーが選択した形式を返します。

ユーザーは、管理者がメールボックス サーバー用に設定したサポートされているタイム ゾーンから選択することにより、Outlook クライアントで好みのタイム ゾーンを設定できます。 管理者は、Windows タイム ゾーン形式または インターネット割り当て番号機関 (IANA) タイム ゾーン ( オルソン タイム ゾーンとも呼ばれます) 形式でタイム ゾーンを設定できます。 既定値は Windows 形式です。

このGET操作は、管理者が設定した形式でユーザーの優先タイムゾーンを返します。 タイム ゾーンを特定の形式 (Windows または IANA) にする場合は、最初にメールボックス設定としてその形式の優先タイム ゾーンを更新します。 その後は、その形式でタイム ゾーンを取得できるようになります。 または、アプリ内で形式変換を個別に管理することもできます。

この API は、次の国内クラウド展開で使用できます。

グローバル サービス 米国政府機関 L4 米国政府機関 L5 (DOD) 21Vianet が運営する中国

アクセス許可

この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください

アクセス許可の種類 最小特権アクセス許可 特権の高いアクセス許可
委任 (職場または学校のアカウント) MailboxSettings.Read MailboxSettings.ReadWrite
委任 (個人用 Microsoft アカウント) MailboxSettings.Read MailboxSettings.ReadWrite
アプリケーション MailboxSettings.Read MailboxSettings.ReadWrite

HTTP 要求

ユーザーのすべてのメールボックス設定を取得する場合:

GET /me/mailboxSettings
GET /users/{id|userPrincipalName}/mailboxSettings

特定の設定を取得するには、自動応答の設定、日付形式、ロケール、時刻形式、タイム ゾーン、勤務時間、またはユーザーの受信者またはメールボックスの種類 (ユーザーの目的など) のみを取得します。

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

オプションのクエリ パラメーター

また、このメソッドは応答をカスタマイズするための一部の OData クエリ パラメーターをサポートします。

要求ヘッダー

名前 説明
Authorization string ベアラー {token}。 必須です。

要求本文

このメソッドには、要求本文を指定しません。

応答

成功した場合、このメソッドは 200 OK 応答コードと、次に示す要求されたオブジェクトのいずれかを応答本文で返します。

例 1: サインインしているユーザーのメールボックスのすべてのメールボックス設定を取得する

自動応答、日付形式、ロケール (言語と国/地域)、時刻形式、タイム ゾーン、稼働時間、ユーザーの目的の設定を含む、サインインしているユーザーのメールボックスのすべての設定を取得します。

要求

次の例は要求を示しています。

GET https://graph.microsoft.com/v1.0/me/mailboxSettings

応答

サインインしているユーザーのすべてのメールボックス設定を含む応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Me/mailboxSettings",
    "automaticRepliesSetting": {
        "status": "Scheduled",
        "externalAudience": "All",
        "scheduledStartDateTime": {
            "dateTime": "2016-03-14T07:00:00.0000000",
            "timeZone": "UTC"
        },
        "scheduledEndDateTime": {
            "dateTime": "2016-03-28T07:00:00.0000000",
            "timeZone": "UTC"
        },
        "internalReplyMessage": "<html>\n<body>\n<p>I'm at our company's worldwide reunion and will respond to your message as soon as I return.<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"
    },
    "timeZone":"UTC",
    "language":{
      "locale":"en-US",
      "displayName":"English (United States)"
    },
    "workingHours":{
        "daysOfWeek":[
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday"
        ],
        "startTime": "08:00:00.0000000",
        "endTime": "17:00:00.0000000",
        "timeZone":{
            "name":"Pacific Standard Time"
        }
    },
    "userPurpose": {
        "value": "user"
    },
    "dateFormat": "MM/dd/yyyy",
    "timeFormat": "hh:mm tt",
    "delegateMeetingMessageDeliveryOptions": "sendToDelegateOnly"
}

例 2: サインインしているユーザーのメールボックスの自動応答設定を具体的に取得する

要求

次の例は要求を示しています。

GET https://graph.microsoft.com/v1.0/me/mailboxSettings/automaticRepliesSetting

応答

自動応答設定のみを含む応答の例を次に示します。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

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's worldwide reunion and will respond to your message as soon as I return.<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"
}

例 3: サインインしているユーザーのメールボックスの稼働時間の設定を具体的に取得する

要求

次の例は要求を示しています。

GET https://graph.microsoft.com/v1.0/me/mailboxSettings/workingHours

応答

勤務時間の設定のみを含む応答の例を次に示します。 ユーザーの就業時間には、カスタム タイム ゾーンが適用されていることに注意してください。

注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('94447c6e-ea4c-494c-a9ed-d905e366c5cb')/mailboxSettings/workingHours",
    "daysOfWeek":[
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday",
        "saturday"
    ],
    "startTime":"09:00:00.0000000",
    "endTime":"18:30:00.0000000",
    "timeZone":{
        "@odata.type":"#microsoft.graph.customTimeZone",
        "bias":-200,
        "name":"Customized Time Zone",
        "standardOffset":{
            "time":"02:00:00.0000000",
            "dayOccurrence":4,
            "dayOfWeek":"sunday",
            "month":5,
            "year":0
        },
        "daylightOffset":{
            "daylightBias":-100,
            "time":"02:00:00.0000000",
            "dayOccurrence":2,
            "dayOfWeek":"sunday",
            "month":10,
            "year":0
        }
    }
}

例 4: サインインしているユーザーのメールボックスのユーザー目的の設定を具体的に取得する

要求

次の例は要求を示しています。

GET https://graph.microsoft.com/v1.0/me/mailboxSettings/userPurpose

応答

ユーザー の目的 の設定のみを含む応答の例を次に示します。

HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('622eaaff-0683-4862-9de4-f2ec83c2bd98')/mailboxSettings/userPurpose",
    "value": "user"
}