我正在使用 microsoft-graph api sdk 这里是 url:msgraph-sdk-php
我需要检查 Outlook 日历中用户的约会是否可用/忙碌。
我正在尝试使用以下代码
$graph = new Graph();
$graph->setAccessToken($this->getToken($calendar));
$data = [
'Schedules' => 'useremail@gmail.com',
'Start' => [
'DateTime' => '2019-06-8T09:00:00+0530',
'TimeZone' => 'Pacific Standard Time',
],
'End' => [
'DateTime' => '2019-06-9T09:00:00+0530',
'TimeZone' => 'Pacific Standard Time',
],
'availabilityViewInterval' => '30',
];
$url = "/me/calendar/getschedule";
$response = $graph->createRequest("POST", $url)
->attachBody($data)
->setReturnType(Model\ScheduleItem::class)
->execute();
我收到以下错误:消息:“客户端错误:POST https://graph.microsoft.com/v1.0/me/calendar/getschedule
导致400 Bad Request
响应:↵{↵“错误”:{↵“代码”:“RequestBodyRead”,↵“消息”:“尝试读取空集合参数值时我(截断...)↵</p>
我还检查了这个微软文档的详细信息,这里是网址:outlook-get-free-busy-schedule
我没有在文档中找到使用 php microsoft-graph sdk 的 getschedule-api。我需要使用 php microsoft-graph api sdk。
请为我提供有关此错误的任何解决方案。
谢谢。