event: tentativelyAccept

命名空间:microsoft.graph

暂时接受用户 日历中的 指定 事件

如果事件允许针对新时间的建议,则当对事件做出暂定响应时,被邀请者可以选择通过包含 proposedNewTime 参数来建议备选 时间。 若要详细了解如何建议时间,以及如何接收和接受新时间建议,请参阅 建议新的会议时间

权限

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限

权限类型 权限(从最低特权到最高特权)
委派(工作或学校帐户) Calendars.ReadWrite
委派(个人 Microsoft 帐户) Calendars.ReadWrite
应用程序 Calendars.ReadWrite

HTTP 请求

POST /me/events/{id}/tentativelyAccept
POST /users/{id | userPrincipalName}/events/{id}/tentativelyAccept

POST /me/calendar/events/{id}/tentativelyAccept
POST /users/{id | userPrincipalName}/calendar/events/{id}/tentativelyAccept

POST /me/calendars/{id}/events/{id}/tentativelyAccept
POST /users/{id | userPrincipalName}/calendars/{id}/events/{id}/tentativelyAccept

POST /me/calendargroups/{id}/calendars/{id}/events/{id}/tentativelyAccept
POST /users/{id | userPrincipalName}/calendargroups/{id}/calendars/{id}/events/{id}/tentativelyAccept

请求标头

名称 类型 说明
Authorization string Bearer {token}。必需。
Content-Type string 实体正文中的数据性质。必需。

请求正文

在请求正文中,提供具有以下参数的 JSON 对象。

参数 类型 说明
注释 String 响应中包含的文本。可选。
proposedNewTime timeSlot 被邀请者为开始和结束会议请求建议的备用日期/时间。 仅对允许新时间建议的事件有效。 设置此参数需要将 sendResponse 设置为 true。 可选。
sendResponse Boolean 如果将响应发送给组织者,则值为 true;否则为 false。可选。默认值为 true

响应

如果成功,此方法返回 202 Accepted 响应代码。它不在响应正文中返回任何内容。

如果发生以下一个或两个情况,此操作将返回 HTTP 400:

  • 包含 proposedNewTime 参数,但 事件的 allowNewTimeProposals 属性 false
  • 包含 proposedNewTime 参数,但 sendResponse 参数设置为 false

示例

下面是一个如何调用此 API 的示例。

请求

在下面的示例中,登录用户对指定事件做出暂定响应,将 sendResponse 参数设置为 true,并包括 proposedNewTime 参数中的备选时间。

POST https://graph.microsoft.com/v1.0/me/events/{id}/tentativelyAccept
Content-type: application/json

{
  "comment": "I may not be able to make this week. How about next week?",
  "sendResponse": true,
  "proposedNewTime": {
      "start": { 
          "dateTime": "2019-12-02T18:00:00", 
          "timeZone": "Pacific Standard Time" 
      }, 
      "end": { 
          "dateTime": "2019-12-02T19:00:00", 
          "timeZone": "Pacific Standard Time" 
      }     
  }
}

响应

下面是一个响应示例。

HTTP/1.1 202 Accepted