You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于MS Graph与PHP添加Outlook可识别的会议室资源

解决Outlook日历事件无法识别会议室为资源的问题

问题出在你对Location字段的使用方式上,Outlook的会议室(资源)本质是特殊的邮箱账户,需要将其作为资源类型的参会者添加到Attendees数组中,而不是放在Location字段里。

修改后的代码示例

$response = [
    'Subject' => $subject,
    'Body' => [
        'ContentType' => 'HTML',
        'Content' => 'This is event generated by Clebex!'
    ],
    'Start' => [
        'DateTime' => $declaration->datetime_from,
        'TimeZone' => 'UTC'
    ],
    'End' => [
        'DateTime' => $declaration->datetime_to,
        'TimeZone' => 'UTC'
    ],
    'Attendees' => array_merge($attendees, [
        [
            'EmailAddress' => [
                'Address' => 'room1@example.com',
                'Name' => 'Room 1'
            ],
            'Type' => 'resource' // 关键:标记为资源类型
        ]
    ]),
    'Location' => [
        'DisplayName' => 'Room 1' // 保留显示名称用于界面展示
    ],
    'isOnlineMeeting' => true,
    'onlineMeetingProvider' => $meetingProvider
];

关键说明

  • 把会议室信息加入Attendees数组并设置Type为resource,Outlook会自动识别这是会议室资源,同时处理其预订状态。
  • Location字段只需保留简单的显示名称,用于在界面上展示位置信息,无需嵌套复杂结构。
  • 确保room1@example.com是Exchange/Office 365中已配置的有效资源账户。

内容的提问来源于stack exchange,提问作者MSM

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 04:20:22