编辑会议不再有效 - Office 365 Graph API
Edit meeting no longer working - Office 365 Graph API
我们有一个留言簿,它使用 Office 365 calanders 来管理通行证 (1-10) 以及分配给谁的通行证和时间。
我们使用平板电脑 运行 网页让人们进出。
直到今天,它都运行良好。
我们无法再使用 php api 将任何人注销。
我查看了 api 个已知问题和新发行说明,但在其中找不到任何内容。
我已经尝试打开错误报告,但没有收到任何回复。
//update current event
error_reporting(E_ALL);
$curl = curl_init();
$endnow = date("Y-m-d\TH:i:s");
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
$test = "{\r\n\t\"end\": {\r\n\t\t\"dateTime\": \"" . $endnow . ".0000000\",\r\n\t\t\"timeZone\": \"UTC\"\r\n\t}\r\n}";
//echo $test;
$authurl = "https://graph.microsoft.com/beta/users/guest".$_POST['signoutnumber']."@trustsystems.co.uk/events/";
curl_setopt_array($curl, array(
CURLOPT_URL => $authurl.$id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => $test,
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Authorization: Bearer " . $result->access_token,
"Cache-Control: no-cache",
"Connection: keep-alive",
"Content-Type: application/json",
"Host: graph.microsoft.com",
"accept-encoding: gzip, deflate",
"cache-control: no-cache",
"content-length: 86"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
这段代码应该做的是将点击的日历(在上一页)的结束时间更新为现在。
据我所知,这并没有抛出错误或事实上做任何事情。
这上周奏效了,有人能解释一下吗?
编辑:
我已经打印了回复,这就是我得到的:
{ "error": { "code": "ErrorPropertyValidationFailure", "message": "At least one property failed validation.", "innerError": { "request-id": "7cc59f12-8523-40d2-bef4-f1b0a09cea59", "date": "2019-10-31T10:11:21" } } }
同样在昨天下午的一段时间里,它又随机开始工作了。
$response 变量包含什么?如果 API 调用出现问题,则错误消息将出现在 $response 中。
编辑:
好的,$response 中的错误表明它不喜欢 $test 中的某些内容。产生这个错误时$test包含什么?
所以我发现可能是我的问题。
我正在使用 "GMT Standard Time" 发送会议邀请,更改会议结束时间的请求是在 "UTC"。
在应用夏令时之前,此方法运行良好。
我已经更改了时区,它似乎可以工作,但我会在接下来的 24 小时内进行测试。
编辑:
所以这实际上现在有效。我必须做的是日期时间:
//what this does is check if we are in daylight savings or not
if (date('I', time()))
{
$endnow = date("Y-m-d\TH:i:s");
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
}
else
{
$endnow = date("Y-m-d\TH:i:s", time()+3600);
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
}
我们有一个留言簿,它使用 Office 365 calanders 来管理通行证 (1-10) 以及分配给谁的通行证和时间。
我们使用平板电脑 运行 网页让人们进出。
直到今天,它都运行良好。
我们无法再使用 php api 将任何人注销。
我查看了 api 个已知问题和新发行说明,但在其中找不到任何内容。
我已经尝试打开错误报告,但没有收到任何回复。
//update current event
error_reporting(E_ALL);
$curl = curl_init();
$endnow = date("Y-m-d\TH:i:s");
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
$test = "{\r\n\t\"end\": {\r\n\t\t\"dateTime\": \"" . $endnow . ".0000000\",\r\n\t\t\"timeZone\": \"UTC\"\r\n\t}\r\n}";
//echo $test;
$authurl = "https://graph.microsoft.com/beta/users/guest".$_POST['signoutnumber']."@trustsystems.co.uk/events/";
curl_setopt_array($curl, array(
CURLOPT_URL => $authurl.$id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => $test,
CURLOPT_HTTPHEADER => array(
"Accept: */*",
"Authorization: Bearer " . $result->access_token,
"Cache-Control: no-cache",
"Connection: keep-alive",
"Content-Type: application/json",
"Host: graph.microsoft.com",
"accept-encoding: gzip, deflate",
"cache-control: no-cache",
"content-length: 86"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
这段代码应该做的是将点击的日历(在上一页)的结束时间更新为现在。
据我所知,这并没有抛出错误或事实上做任何事情。
这上周奏效了,有人能解释一下吗?
编辑:
我已经打印了回复,这就是我得到的:
{ "error": { "code": "ErrorPropertyValidationFailure", "message": "At least one property failed validation.", "innerError": { "request-id": "7cc59f12-8523-40d2-bef4-f1b0a09cea59", "date": "2019-10-31T10:11:21" } } }
同样在昨天下午的一段时间里,它又随机开始工作了。
$response 变量包含什么?如果 API 调用出现问题,则错误消息将出现在 $response 中。
编辑:
好的,$response 中的错误表明它不喜欢 $test 中的某些内容。产生这个错误时$test包含什么?
所以我发现可能是我的问题。
我正在使用 "GMT Standard Time" 发送会议邀请,更改会议结束时间的请求是在 "UTC"。
在应用夏令时之前,此方法运行良好。
我已经更改了时区,它似乎可以工作,但我会在接下来的 24 小时内进行测试。
编辑: 所以这实际上现在有效。我必须做的是日期时间:
//what this does is check if we are in daylight savings or not
if (date('I', time()))
{
$endnow = date("Y-m-d\TH:i:s");
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
}
else
{
$endnow = date("Y-m-d\TH:i:s", time()+3600);
$timestamp = strtotime($endnow);
$time = $timestamp - (1 * 60 * 60);
$endnow = date("Y-m-d\TH:i:s", $time);
}