在共享或委托日历中创建 Outlook 事件Create Outlook events in a shared or delegated calendar

在 Outlook 中,客户可以与其他用户共享日历,并让他们查看、创建或修改该日历中的事件。In Outlook, customers can share a calendar with other users and let them view, create, or modify events in that calendar. 客户还可以授权代理代表自己执行操作、接收或答复会议请求,或在日历中创建或更改项。Customers can also grant a delegate to act on their behalf, to receive or respond to meeting requests, or create or change items in the calendar.

Microsoft Graph 支持以编程方式读取或写入其他用户已共享日历中的事件、读取共享日历以及更新共享者的日历名称。Programmatically, Microsoft Graph supports reading or writing events in calendars that have been shared by other users, as well as reading the shared calendars, and updating the calendar name for sharees. 此支持还适用于已委托的日历。The support also applies to calendars that have been delegated. 本文的其余部分介绍了如何在共享或委托日历中创建会议事件。The rest of this article walks through creating a meeting event in a shared or delegated calendar. 有关获取事件,请参阅获取共享日历或委托日历中的 Outlook 事件For getting events, refer to Get Outlook events in a shared or delegated calendar.

下面的演练使用示例方案,其中 Alex 在 Outlook 中将其主要日历委派给 Adele,并保留默认的 Outlook 邮箱设置以将会议请求和响应仅定向给委托人。The walkthrough below uses the example scenario where Alex has delegated his primary calendar to Adele in Outlook, and kept the default Outlook mailbox setting to direct meeting requests and responses to only delegates. (此设置对应于设置为默认值 sendToDelegateOnly 的 Alex mailboxSettingsdelegateMeetingMessageDeliveryOptions 属性。)(This setting corresponds to the delegateMeetingMessageDeliveryOptions property of Alex' mailboxSettings set as the default value sendToDelegateOnly.)

本演练介绍了几个后续步骤:The walkthrough describes a few subsequent steps:

  1. Adele 获取由 Alex 委派给她的日历Adele gets the calendar that Alex has delegated to her.
  2. Adele 代表 Alex 将会议邀请发送给 Christie 和 MeganAdele sends a meeting invitation to Christie and Megan on Alex' behalf.
  3. Christie 收到会议请求,并检查其日历中的关联事件Christie receives the meeting request, and inspects the associated event in her calendar.
  4. Christie 对邀请做出暂定响应Christie responds tentative to the invitation.
  5. Adele 收到 Christie 的响应邮件Adele receives Christie's response message.
  6. 作为活动的一部分,Alex 检查与会者的响应Alex checks attendees' responses as part of the event.

如果 Alex 已与 Adele 共享其日历,但未向 Adele 委派该日历:If Alex has shared and not delegated his calendar with Adele:

  • 如果以 Adele 的身份登录,则应用可以获取 Alex 与 Adele 共享的日历Signed in as Adele, an app can get the calendar that Alex has shared with Adele.
  • 应用可以使用步骤 2 到 4 中的请求和响应,以与委派日历相同的方式应用于共享日历。The app can use the requests and responses in steps 2 to 4 to apply to the shared calendar the same way as the delegated calendar.
  • 在步骤 5 中,应用以 Alex 而不是 Adele 的身份登录,以接收 Christie 的响应邮件。In step 5, the app can sign in as Alex, instead of Adele, to receive Christie's response message.

步骤 1:Adele 获取委派的日历Step 1: Adele gets the delegated calendar

以 Adele 的身份登录,获取她有权访问的日历并识别由 Alex 向她委派的日历,以便在下一步中使用它在该日历中创建事件。Signed in as Adele, get the calendars she has access to and identify the one Alex has delegated to her, so to use it in the next step to create an event in that calendar.

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

请注意,成功响应包括响应代码 HTTP 200、Adele 自己的主要日历以及由 Alex 在 Adele 的邮箱中委派的日历副本,其中包含以下属性:Notice a successful response includes the response code HTTP 200, Adele's own primary calendar, and a copy of the calendar delegated by Alex in Adele's mailbox, with the following properties:

  • canShare 为 false,因为 Adele 只是委托人,而不是日历所有者。canShare is false since Adele is only a delegate and not the calendar owner.
  • canEdit 为 true,因为作为委托人,Adele 对委派日历中的非私人活动具有写入访问权限。canEdit is true since as delegate, Adele has write access to non-private events in the delegated calendar.
  • ownerAlex Wilber,表示它是 Alex 的日历。owner is Alex Wilber indicating it is Alex' calendar.
HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('d3b9214b-dd8b-441d-b7dc-c446c9fa0e69')/calendars",
    "value": [
        {
            "id": "AQMkADGkAAAJMjAAAAA==",
            "name": "Calendar",
            "color": "auto",
            "changeKey": "NDznl+Uh50WkanaCOKHkaQAAAAACXQ==",
            "canShare": true,
            "canViewPrivateItems": true,
            "canEdit": true,
            "owner": {
                "name": "Adele Vance",
                "address": "AdeleV@contoso.OnMicrosoft.com"
            }
        },
        {
            "id": "AAMkADRpAABf0JlzAAA=",
            "name": "Alex Wilber",
            "color": "auto",
            "changeKey": "NDznl+Uh50WkanaCOKHkaQAAX8m4eQ==",
            "canShare": false,
            "canViewPrivateItems": false,
            "canEdit": true,
            "owner": {
                "name": "Alex Wilber",
                "address": "AlexW@contoso.OnMicrosoft.com"
            }
        }
    ]
}

注意 以 Adele 的身份登录,你也可以直接从 Alex 的邮箱获取委派的日历,方法是指定 Alex 的身份和 calendar 快捷方式,如 GET https://graph.microsoft.com/v1.0/users/AlexW@contoso.OnMicrosoft.com/calendar 中所示。NOTE Signed in as Adele, you can alternatively get the delegated calendar directly from Alex' mailbox, by specifying Alex' identity and the calendar shortcut, as in GET https://graph.microsoft.com/v1.0/users/AlexW@contoso.OnMicrosoft.com/calendar. 返回的日历 ID 仅对应于 Alex 的邮箱。The returned calendar ID corresponds to only Alex' mailbox.

步骤 2:Adele 代表 Alex 创建并发送邀请Step 2: Adele creates and sends an invitation on Alex' behalf

以 Adele 的身份登录,使用从步骤 1 中获得的日历 ID 在委派日历中创建 event,并代表 Alex 将其发送给 Christie 和 Megan:Signed in as Adele, use the calendar ID obtained from step 1 to create an event in the delegated calendar and send it to Christie and Megan, on Alex' behalf:

POST https://graph.microsoft.com/v1.0/me/calendars/AAMkADRpAABf0JlzAAA=/events

Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json

{
  "subject": "Christmas dinner",
  "body": {
    "contentType": "HTML",
    "content": "Happy holidays!"
  },
  "start": {
      "dateTime": "2019-12-25T18:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "end": {
      "dateTime": "2019-12-25T22:00:00",
      "timeZone": "Pacific Standard Time"
  },
  "location":{
      "displayName":"Alex' home"
  },
  "attendees": [
    {
      "emailAddress": {
        "address":"meganb@contoso.onmicrosoft.com",
        "name": "Megan Bowen"
      },
      "type": "required"
    },
    {
      "emailAddress": {
        "address":"ChristieC@contoso.onmicrosoft.com",
        "name": "Christie Cline"
      },
      "type": "required"
    }
  ]
}

请注意,成功响应包括 HTTP 201 和以下 event 属性:Notice a successful response includes HTTP 201 and the following event properties:

  • isOrganizer 设置为 true。isOrganizer is set to true. 通常情况下,如果日历所有者 (Alex) 是会议的组织者,则此属性为 true。In general, this property is true if the calendar owner (Alex) is the organizer of the meeting. 这也适用于委托人 (Adele) 代表所有者组织会议的情形。This also applies if a delegate (Adele) organized the meeting on behalf of the owner.
  • attendees 集合指定 Megan 和 Christie。The attendees collection specifies Megan and Christie.
  • organizer 设置为 Alex,因为邀请是由 Alex 的委托人 (Adele) 在 Alex 的主要日历中发送的。organizer is set to Alex, since the invitation was sent by Alex' delegate (Adele) in Alex' primary calendar.
  • attendeesorganizer 都未指定委托人 (Adele)。Neither the attendees nor organizer specifies the delegate (Adele).
HTTP/1.1 201 Created
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('d3b9214b-dd8b-441d-b7dc-c446c9fa0e69')/calendars('AAMkADRpAABf0JlzAAA%3D')/events/$entity",
    "@odata.etag": "W/\"NDznl+Uh50WkanaCOKHkaQAAX8m47Q==\"",
    "id": "AAMkADI4oeRpAABf0LrcAAA=",
    "createdDateTime": "2019-12-21T04:59:01.9766929Z",
    "lastModifiedDateTime": "2019-12-21T04:59:02.0214967Z",
    "changeKey": "NDznl+Uh50WkanaCOKHkaQAAX8m47Q==",
    "categories": [],
    "originalStartTimeZone": "Pacific Standard Time",
    "originalEndTimeZone": "Pacific Standard Time",
    "iCalUId": "040000008200FEFE0BA532444B5FD89BDE22BA103",
    "reminderMinutesBeforeStart": 15,
    "isReminderOn": false,
    "hasAttachments": false,
    "subject": "Christmas dinner",
    "bodyPreview": "Happy holidays!",
    "importance": "normal",
    "sensitivity": "normal",
    "isAllDay": false,
    "isCancelled": false,
    "isOrganizer": true,
    "responseRequested": true,
    "seriesMasterId": null,
    "showAs": "busy",
    "type": "singleInstance",
    "webLink": "https://outlook.office365.com/owa/?itemid=AAMkADI4oeRpAABf0LrcAAA%3D&exvsurl=1&path=/calendar/item",
    "onlineMeetingUrl": null,
    "recurrence": null,
    "responseStatus": {
        "response": "organizer",
        "time": "0001-01-01T00:00:00Z"
    },
    "body": {
        "contentType": "html",
        "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nHappy holidays!\r\n</body>\r\n</html>\r\n"
    },
    "start": {
        "dateTime": "2019-12-25T18:00:00.0000000",
        "timeZone": "Pacific Standard Time"
    },
    "end": {
        "dateTime": "2019-12-25T22:00:00.0000000",
        "timeZone": "Pacific Standard Time"
    },
    "location": {
        "displayName": "Alex' home",
        "locationType": "default",
        "uniqueId": "Alex' home",
        "uniqueIdType": "private"
    },
    "locations": [
        {
            "displayName": "Alex' home",
            "locationType": "default",
            "uniqueId": "Alex' home",
            "uniqueIdType": "private"
        }
    ],
    "attendees": [
        {
            "type": "required",
            "status": {
                "response": "none",
                "time": "0001-01-01T00:00:00Z"
            },
            "emailAddress": {
                "name": "Megan Bowen",
                "address": "MeganB@contoso.OnMicrosoft.com"
            }
        },
        {
            "type": "required",
            "status": {
                "response": "none",
                "time": "0001-01-01T00:00:00Z"
            },
            "emailAddress": {
                "name": "Christie Cline",
                "address": "ChristieC@contoso.OnMicrosoft.com"
            }
        }
    ],
    "organizer": {
        "emailAddress": {
            "name": "Alex Wilber",
            "address": "AlexW@contoso.OnMicrosoft.com"
        }
    }
}

步骤 3:Christie 收到会议请求,并检查其日历中的关联事件Step 3: Christie receives meeting request and inspects the associated event in her calendar

传递会议请求时,Outlook 会自动在 Christie 的日历中创建暂定 eventUpon delivering the meeting request, Outlook automatically creates a tentative event in Christie's calendar.

以 Christie 的身份登录,获取与步骤 2 中的会议请求相关联的 eventMessageeventSigned in as Christie, get the eventMessage and event that are associated with the meeting request from step 2:

GET https://graph.microsoft.com/v1.0/me/messages/AAMkADADVj3fyAABZ5hYdAAA=?$expand=microsoft.graph.eventMessage/event

请注意,成功响应包括响应代码 HTTP 200 和以下 eventMessage 属性:Notice a successful response includes the response code HTTP 200 and the following eventMessage properties:

  • meetingMessageType 指定此邮件为 meetingRequestmeetingMessageType specifies this message is meetingRequest.
  • sender 是 Adele。sender is Adele.
  • from 是 Alex。from is Alex.
  • toRecipients 包括 Megan 和 Christie。toRecipients include Megan and Christie.

添加以下 event 属性:And the following event properties:

  • attendees 包括 Alex、Megan 和 Christie。attendees include Alex, Megan, and Christie.
  • organizer 是 Alex。organizer is Alex.

Adele 的身份仅显示在 eventMessagesender 属性中,而不是显示在关联的 event 中。Adele's identity appears only in the sender property of the eventMessage and not in the associated event.

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

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('662b947c-d9a1-4064-926c-eba1316d4462')/messages(microsoft.graph.eventMessage/event())/$entity",
    "@odata.type": "#microsoft.graph.eventMessage",
    "@odata.etag": "W/\"CwAAABYAAADK82uJYVo4RrFV3ADVj3fyAABZ378h\"",
    "id": "AAMkADADVj3fyAABZ5hYdAAA=",
    "createdDateTime": "2019-12-21T04:59:03Z",
    "lastModifiedDateTime": "2019-12-21T04:59:04Z",
    "changeKey": "CwAAABYAAADK82uJYVo4RrFV3ADVj3fyAABZ378h",
    "categories": [],
    "receivedDateTime": "2019-12-21T04:59:03Z",
    "sentDateTime": "2019-12-21T04:59:01Z",
    "hasAttachments": false,
    "internetMessageId": "<DM6PR17MB3593711A1C0A098167F5A977A12C0@DM6PR17MB3593.namprd17.prod.outlook.com>",
    "subject": "Christmas dinner",
    "bodyPreview": "Happy holidays!",
    "importance": "normal",
    "parentFolderId": "AQMkADIAAAIBDAAAAA==",
    "conversationId": "AAQkADNqQlzYAM8jQM=",
    "conversationIndex": "AdW3u1xx5S7TYrbluE2pCXNgAzyNAw==",
    "isDeliveryReceiptRequested": null,
    "isReadReceiptRequested": false,
    "isRead": true,
    "isDraft": false,
    "webLink": "https://outlook.office365.com/owa/?ItemID=AAMkADADVj3fyAABZ5hYdAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
    "inferenceClassification": "focused",
    "meetingMessageType": "meetingRequest",
    "body": {
        "contentType": "html",
        "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nHappy holidays!\r\n</body>\r\n</html>\r\n"
    },
    "sender": {
        "emailAddress": {
            "name": "Adele Vance",
            "address": "AdeleV@contoso.OnMicrosoft.com"
        }
    },
    "from": {
        "emailAddress": {
            "name": "Alex Wilber",
            "address": "AlexW@contoso.OnMicrosoft.com"
        }
    },
    "toRecipients": [
        {
            "emailAddress": {
                "name": "Megan Bowen",
                "address": "MeganB@contoso.OnMicrosoft.com"
            }
        },
        {
            "emailAddress": {
                "name": "Christie Cline",
                "address": "ChristieC@contoso.OnMicrosoft.com"
            }
        }
    ],
    "ccRecipients": [],
    "bccRecipients": [],
    "replyTo": [],
    "flag": {
        "flagStatus": "notFlagged"
    },
    "event@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('662b947c-d9a1-4064-926c-eba1316d4462')/messages('AAMkADADVj3fyAABZ5hYdAAA%3D')/microsoft.graph.eventMessage/microsoft.graph.eventMessage/event/$entity",
    "event": {
        "@odata.etag": "W/\"yvNriWFaOEaxVdwA1Y938gAAX+T7Jg==\"",
        "id": "AAMkADADVj3fyAABZ5ieyAAA=",
        "createdDateTime": "2019-12-21T04:59:03.4336242Z",
        "lastModifiedDateTime": "2019-12-27T01:38:32.3766961Z",
        "changeKey": "yvNriWFaOEaxVdwA1Y938gAAX+T7Jg==",
        "categories": [],
        "originalStartTimeZone": "Pacific Standard Time",
        "originalEndTimeZone": "Pacific Standard Time",
        "iCalUId": "040000008200FEFE0BA532444B5FD89BDE22BA103",
        "reminderMinutesBeforeStart": 15,
        "isReminderOn": true,
        "hasAttachments": false,
        "subject": "Christmas dinner",
        "bodyPreview": "Happy holidays!",
        "importance": "normal",
        "sensitivity": "normal",
        "isAllDay": false,
        "isCancelled": false,
        "isOrganizer": false,
        "responseRequested": true,
        "seriesMasterId": null,
        "showAs": "tentative",
        "type": "singleInstance",
        "webLink": "https://outlook.office365.com/owa/?itemid=AAMkADADVj3fyAABZ5ieyAAA%3D&exvsurl=1&path=/calendar/item",
        "onlineMeetingUrl": null,
        "recurrence": null,
        "responseStatus": {
            "response": "none",
            "time": "2019-12-21T05:16:48.8931825Z"
        },
        "body": {
            "contentType": "html",
            "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nHappy holidays!\r\n</body>\r\n</html>\r\n"
        },
        "start": {
            "dateTime": "2019-12-26T02:00:00.0000000",
            "timeZone": "UTC"
        },
        "end": {
            "dateTime": "2019-12-26T06:00:00.0000000",
            "timeZone": "UTC"
        },
        "location": {
            "displayName": "Alex' home",
            "locationType": "default",
            "uniqueId": "Alex' home",
            "uniqueIdType": "private"
        },
        "locations": [
            {
                "displayName": "Alex' home",
                "locationType": "default",
                "uniqueId": "1396aaf3-e344-4567-a4e3-797557ec24c8",
                "uniqueIdType": "locationStore"
            }
        ],
        "attendees": [
            {
                "type": "required",
                "status": {
                    "response": "none",
                    "time": "0001-01-01T00:00:00Z"
                },
                "emailAddress": {
                    "name": "Alex Wilber",
                    "address": "AlexW@contoso.OnMicrosoft.com"
                }
            },
            {
                "type": "required",
                "status": {
                    "response": "none",
                    "time": "0001-01-01T00:00:00Z"
                },
                "emailAddress": {
                    "name": "Megan Bowen",
                    "address": "MeganB@contoso.OnMicrosoft.com"
                }
            },
            {
                "type": "required",
                "status": {
                    "response": "none",
                    "time": "0001-01-01T00:00:00Z"
                },
                "emailAddress": {
                    "name": "Christie Cline",
                    "address": "ChristieC@contoso.OnMicrosoft.com"
                }
            }
        ],
        "organizer": {
            "emailAddress": {
                "name": "Alex Wilber",
                "address": "AlexW@contoso.OnMicrosoft.com"
            }
        }
    }
}

步骤 4:Christie 响应会议请求Step 4: Christie responds to the meeting request

以 Christie 的身份登录,将 event 答复为暂定,并在响应中包括答复邮件:Signed in as Christie, reply to the event as tentative, and include a reply message in the response:

POST https://graph.microsoft.com/v1.0/me/events/AAMkADADVj3fyAABZ5ieyAAA=/tentativelyAccept
Content-type: application/json

{
  "comment": "I will probably be able to make it.",
  "sendResponse": true
}

成功响应将返回“HTTP 202 已接受”。A successful response returns HTTP 202 Accepted.

HTTP/1.1 202 Accepted

步骤 5:Adele 收到响应邮件Step 5: Adele receives the response message

由于 Adele 是 Alex 的主要日历的委托人,Adele 代表 Alex 收到了该日历的所有会议响应。Because Adele is a delegate of Alex' primary calendar, Adele receives all meeting responses for that calendar on Alex' behalf.

以 Adele 的身份登录,获取 eventMessage,它表示由 Christie 在步骤 4 中做出的响应:Signed in as Adele, get the eventMessage that represents the response from Christie in step 4:

GET https://graph.microsoft.com/v1.0/me/messages/AAMkADI4oeRpAABf0HJUAAA=

请注意,成功响应包括响应代码 HTTP 200 和以下 eventMessage 属性:Notice a successful response includes the response code HTTP 200 and the following eventMessage properties:

  • meetingMessageTypemeetingTenativelyAcceptedmeetingMessageType is meetingTenativelyAccepted.
  • from 是 Christie。from is Christie.
  • toRecipients 仅包括 Adele,而不是日历所有者 Alex。toRecipients includes only Adele, but not the calendar owner Alex. 这是因为 Alex 保留了让 Outlook 将所有会议响应仅定向给委托人的默认设置。This is because Alex kept the default to have Outlook direct all meeting responses to only delegates.
HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('d3b9214b-dd8b-441d-b7dc-c446c9fa0e69')/messages/$entity",
    "@odata.type": "#microsoft.graph.eventMessage",
    "@odata.etag": "W/\"DAAAABYAAAA0POeX5SHnRaRqdoI4oeRpAABfybkT\"",
    "id": "AAMkADI4oeRpAABf0HJUAAA=",
    "createdDateTime": "2019-12-21T05:16:55Z",
    "lastModifiedDateTime": "2019-12-21T05:16:57Z",
    "changeKey": "DAAAABYAAAA0POeX5SHnRaRqdoI4oeRpAABfybkT",
    "categories": [],
    "receivedDateTime": "2019-12-21T05:16:56Z",
    "sentDateTime": "2019-12-21T05:16:49Z",
    "hasAttachments": false,
    "internetMessageId": "<86880ccb8ec64184996e46eaddaed279@DM6PR17MB3593.namprd17.prod.outlook.com>",
    "subject": "Tentative: Christmas dinner",
    "bodyPreview": "I will probably be able to make it.",
    "importance": "normal",
    "parentFolderId": "AQMkAD5GkAAAIBDAAAAA==",
    "conversationId": "AAQkADK25bhNqQlzYAM8jQM=",
    "conversationIndex": "AdW3u1xx5S7TYrbluE2pCXNgAzyNAwAAoBoZ",
    "isDeliveryReceiptRequested": null,
    "isReadReceiptRequested": false,
    "isRead": false,
    "isDraft": false,
    "webLink": "https://outlook.office365.com/owa/?ItemID=AAMkADI4oeRpAABf0HJUAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
    "inferenceClassification": "focused",
    "meetingMessageType": "meetingTenativelyAccepted",
    "body": {
        "contentType": "html",
        "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nI will probably be able to make it.\r\n</body>\r\n</html>\r\n"
    },
    "sender": {
        "emailAddress": {
            "name": "Christie Cline",
            "address": "ChristieC@contoso.OnMicrosoft.com"
        }
    },
    "from": {
        "emailAddress": {
            "name": "Christie Cline",
            "address": "ChristieC@contoso.OnMicrosoft.com"
        }
    },
    "toRecipients": [
        {
            "emailAddress": {
                "name": "Adele Vance",
                "address": "AdeleV@contoso.OnMicrosoft.com"
            }
        }
    ],
    "ccRecipients": [],
    "bccRecipients": [],
    "replyTo": [],
    "flag": {
        "flagStatus": "notFlagged"
    }
}

步骤 6:作为活动的一部分,Alex 访问响应Step 6: Alex accesses responses as part of the event

由于 Alex 保留了让 Outlook 将所有会议请求和响应仅定向给委托人的默认设置,Alex 不会收到 Christie 在步骤 4 中做出的响应。Because Alex kept the default to have Outlook direct all meeting requests and responses to only delegates, Alex does not receive Christie's response from step 4. 但是,他可以通过其主要日历中的 event 获取响应。He can however get the response through the event in his primary calendar.

以 Alex 的身份登录,获取 Adele 在步骤 2 中创建的 event,并从 attendees 属性获取响应:Signed in as Alex, get the event that Adele created in step 2 and get responses from the attendees property:

GET https://graph.microsoft.com/v1.0/me/calendar/events/AAMkADJXJGu0AABf02qwAAA=

请注意,成功响应包括响应代码 HTTP 200 和以下 event 属性:Notice a successful response includes the response code HTTP 200 and the following event properties:

  • isOrganizer 为 true。isOrganizer is true.
  • attendees 仅包括 Megan 和 Christie。attendees include only Megan and Christie.
  • 每个 attendee 实例的 status 属性均指示参与者的任何响应:The status property of each attendee instance indicates any response from the attendee:
    • Megan 的响应是 noneMegan's response is none.
    • Christie 的响应是 tentativelyAcceptedChristie's response is tentativelyAccepted.
  • organizer 是 Alex。organizer is Alex.
  • 返回的 event 中没有任何属性指示委托人 Adele。No property in the returned event indicates the delegate, Adele.
HTTP/1.1 200 OK
Content-type: application/json

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('64339082-ed84-4b0b-b4ab-004ae54f3747')/calendars('AQMkADAw7QAAAJfygAAAA%3D%3D')/events/$entity",
    "@odata.etag": "W/\"NEXywgsVrkeNsFsyVyRrtAAAX8xuhA==\"",
    "id": "AAMkADJXJGu0AABf02qwAAA=",
    "createdDateTime": "2019-12-21T04:59:01.4435895Z",
    "lastModifiedDateTime": "2019-12-21T05:16:54.689345Z",
    "changeKey": "NEXywgsVrkeNsFsyVyRrtAAAX8xuhA==",
    "categories": [],
    "originalStartTimeZone": "Pacific Standard Time",
    "originalEndTimeZone": "Pacific Standard Time",
    "iCalUId": "040000008200FEFE0BA532444B5FD89BDE22BA103",
    "reminderMinutesBeforeStart": 15,
    "isReminderOn": true,
    "hasAttachments": false,
    "subject": "Christmas dinner",
    "bodyPreview": "Happy holidays!",
    "importance": "normal",
    "sensitivity": "normal",
    "isAllDay": false,
    "isCancelled": false,
    "isOrganizer": true,
    "responseRequested": true,
    "seriesMasterId": null,
    "showAs": "busy",
    "type": "singleInstance",
    "webLink": "https://outlook.office365.com/owa/?itemid=AAMkADJXJGu0AABf02qwAAA%3D&exvsurl=1&path=/calendar/item",
    "onlineMeetingUrl": null,
    "recurrence": null,
    "responseStatus": {
        "response": "organizer",
        "time": "0001-01-01T00:00:00Z"
    },
    "body": {
        "contentType": "html",
        "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n</head>\r\n<body>\r\nHappy holidays!\r\n</body>\r\n</html>\r\n"
    },
    "start": {
        "dateTime": "2019-12-26T02:00:00.0000000",
        "timeZone": "UTC"
    },
    "end": {
        "dateTime": "2019-12-26T06:00:00.0000000",
        "timeZone": "UTC"
    },
    "location": {
        "displayName": "Alex' home",
        "locationType": "default",
        "uniqueId": "Alex' home",
        "uniqueIdType": "private"
    },
    "locations": [
        {
            "displayName": "Alex' home",
            "locationType": "default",
            "uniqueId": "Alex' home",
            "uniqueIdType": "private"
        }
    ],
    "attendees": [
        {
            "type": "required",
            "status": {
                "response": "none",
                "time": "0001-01-01T00:00:00Z"
            },
            "emailAddress": {
                "name": "Megan Bowen",
                "address": "MeganB@contoso.OnMicrosoft.com"
            }
        },
        {
            "type": "required",
            "status": {
                "response": "tentativelyAccepted",
                "time": "2019-12-21T05:16:48.8931825Z"
            },
            "emailAddress": {
                "name": "Christie Cline",
                "address": "ChristieC@contoso.OnMicrosoft.com"
            }
        }
    ],
    "organizer": {
        "emailAddress": {
            "name": "Alex Wilber",
            "address": "AlexW@contoso.OnMicrosoft.com"
        }
    }
}

后续步骤Next steps

详细了解以下信息:Find out more about: