【问题标题】:Edit meeting no longer working - Office 365 Graph API编辑会议不再起作用 - Office 365 Graph API
【发布时间】:2019-11-01 18:48:30
【问题描述】:

我们有一个留言簿,它使用 office 365 日历来管理通行证 (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" } } }

也是昨天下午的一段时间,这随机又开始工作了。

【问题讨论】:

    标签: php graph office365api


    【解决方案1】:

    $response 变量包含什么?如果 API 调用出现问题,则错误消息将显示在 $response 中。

    编辑:

    好的,$response 中的错误表明它不喜欢 $t​​est 中的某些内容。生成此错误时,$test 包含什么内容?

    【讨论】:

    • 嗨瑞恩,不知道为什么我没有想到这一点。我已将答案弹出到问题中
    【解决方案2】:

    所以我发现了可能是我的问题。

    我使用“GMT 标准时间”发送会议邀请,更改会议结束时间的请求是“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);
    }
    

    【讨论】:

      猜你喜欢
      • 2018-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多