event: decline

命名空间:microsoft.graph

重要

Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

拒绝用户日历 中指定 事件 的邀请

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

权限

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

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

HTTP 请求

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

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

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

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

请求标头

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

请求正文

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

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

响应

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

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

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

示例

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

请求

下面是一个请求示例。

POST https://graph.microsoft.com/beta/me/events/{id}/decline
Content-type: application/json

{
  "comment": "I won't 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