ユーザーのメールボックスの設定を取得する
名前空間: microsoft.graph
ユーザーの mailboxSettings を取得します。 すべてのメールボックス設定を表示することも、特定の設定を取得することもできます。
ユーザーは、Outlook クライアントを介してメールボックスに以下の設定を行うことができます。
- 自動応答 (メールの受信時にユーザーに自動的に通知)
- 日付の形式
- delegateMeetingMessageDeliveryOptions
- ロケール (言語および国/地域)
- 時刻の形式
- タイム ゾーン
- 稼働時間
ユーザーは Outlook on the web を使用して、好みの日付と時刻の形式を設定できます。 ユーザーは、サポートされている日付 (S) または時刻 (S) 形式のいずれかを選択できます。 このGET操作は、ユーザーが選択した形式を返します。
ユーザーは、管理者がメールボックス サーバー用に設定したサポートされているタイム ゾーンから選択することにより、Outlook クライアントで好みのタイム ゾーンを設定できます。 管理者は、Windows タイム ゾーン形式または Internet Assigned Numbers Authority (IANA) のタイム ゾーン (別称: Olson タイム ゾーン) 形式でタイムゾーンを設定できます。 既定値は Windows 形式です。
このGET操作は、管理者が設定した形式でユーザーの優先タイムゾーンを返します。 タイム ゾーンを特定の形式 (Windows または IANA) にする場合は、最初にメールボックス設定としてその形式の優先タイム ゾーンを更新します。 その後は、その形式でタイム ゾーンを取得できるようになります。 または、アプリ内で形式変換を個別に管理することもできます。
アクセス許可
この 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
オプションのクエリ パラメーター
また、このメソッドは応答をカスタマイズするための一部の OData クエリ パラメーターをサポートします。
要求ヘッダー
| 名前 | 型 | 説明 |
|---|---|---|
| Authorization | string | ベアラー {トークン}。必須。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは 200 OK 応答コードと、次に示す要求されたオブジェクトのいずれかを応答本文で返します。
- mailboxSettings オブジェクト
- automaticRepliesSetting オブジェクト
- string (dateFormat の場合)
- string (delegateMeetingMessageDeliveryOptions 用)
- localeInfo オブジェクト
- string (timeFormat の場合)
- string (timeZone の場合)
- workingHours
例
例 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"
}
},
"dateFormat": "MM/dd/yyyy",
"timeFormat": "hh:mm tt",
"delegateMeetingMessageDeliveryOptions": "sendToDelegateOnly"
}
例 2
リクエスト
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
リクエスト
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
}
}
}
フィードバック
フィードバックの送信と表示