基于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
相关产品推荐
相关产品推荐

