当进行创建事件调用时,与会者会收到一封电子邮件通知事件,但是启用了建议的新时间功能。 我不希望它启用。 需要在下面的请求中添加一些东西。

问题描述 投票:0回答:1
在创建事件时禁用提出新的时间功能。

在本质上,注册的单租户Microsoft Entra ID应用程序:


azure events microsoft-graph-api calendar
1个回答
0
投票
Calendars.ReadWrite
API许可,并授予管理员同意,如下所示:

使用授权类型,授权_Code Flow需要用户交流。要获取

codeenter image description here,我在浏览器中跑了以下

授权请求

https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/authorize?  
client_id=<client_id>
&response_type=code  
&redirect_uri=https://jwt.ms
&response_mode=query  
&scope=https://graph.microsoft.com/.default
&state=12345

enter image description here

成功地创建

authorization_code
使用以下参数创建POST https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token Content-Type: application/x-www-form-urlencoded client_id: <application-id> client_secret: <client-secret> scope: https://graph.microsoft.com/.default grant_type: authorization_code code: <authorization_code generated from browser> redirect_uri: <REDIRECT_URI ,生成的访问令牌:

Create Event Graph API
response:

enter image description here

要通过禁用新的时间功能在Microsoft日历上创建一个事件,默认情况下,此属性设置为

allowNewTimeProposals
,从而允许邀请人建议替代会议时间。
需要设置

true

enter image description hereallowNewTimeProposals:false

response:


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

Body:

{
  "subject": "Meet about next steps",
  "body": {
    "content": "Let's talk about some stuff",
    "contentType": "HTML"
  },
  "start": {
    "dateTime": "2025-03-11T14:00:00",
    "timeZone": "Pacific Standard Time"
  },
  "end": {
    "dateTime": "2025-03-11T15:00:00",
    "timeZone": "Pacific Standard Time"
  },
  "location": {
    "displayName": "Meet Online in Teams Meeting"
  },
  "isOnlineMeeting": true,
  "onlineMeetingProvider": "teamsForBusiness",
  "attendees": [
    {
      "emailAddress": {
        "address": "<[email protected]>",
        "name": "<Attendee_Name>"
      },
      "type": "required"
    }
  ],
  "allowNewTimeProposals": false
}

指出,通过禁用提出的新时间功能,在Microsoft日历上成功创建了事件。

参考:


创建日历事件

    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.