【发布时间】:2019-06-08 01:28:43
【问题描述】:
我想通过提供 OData v4.0 $filter 作为查询参数来对 https://graph.microsoft.com/v1.0/me/calendars/<calendar>/events 端点应用过滤器,但将 eq 应用于 start/timeZone 会导致错误:
当$filter 是subject eq 'My Subject' and start/dateTime eq '1970-01-01T00:00:00.0000000' and end/dateTime eq '1970-01-01T00:01:00.0000000' and start/timeZone eq 'UTC' and end/timeZone eq 'UTC' 我回来了:
{
"error": {
"code": "InvalidDateTime",
"message": "The value 'UTC' of parameter 'DateTime' is invalid.",
"innerError": {
"request-id": "68f797e2-5059-4a8a-8fc6-0063e31d6498",
"date": "2019-06-07T13:46:54"
}
}
}
文档引用了Prefer: outlook.timezone 标头,但仅表明它适用于响应,并没有说明解释请求:
对于所有返回事件的 GET 操作,您可以使用 Prefer: outlook.timezone 标头指定事件开始的时区 以及响应中的结束时间。
如何过滤 (dateTime, timeZone) 组合?如果我不必知道事件的时区,而是可以基于 UTC 进行查询,那将是最好的,但我也不知道该怎么做。
谢谢!
【问题讨论】:
标签: microsoft-graph-api microsoft-graph-calendar