如何通过与会者的电子邮件过滤Google Calendar REST API事件

问题描述 投票:0回答:1

我正在访问Google Calendar REST API for Calendar Events,试图为q参数找出正确的表示法,以过滤电子邮件中识别出与会者之一的所有事件(例如[email protected]

我已经尝试过:q = attendee.email:[email protected][email protected][email protected],q = attendees.email =“ [email protected]“ ...

但没有结果(如果填写了[[q参数,则为空列表)]

是否完全受支持?

是否有一个有效的

q

参数字段列表供您过滤?
google-calendar-api google-apis-explorer
1个回答
0
投票
您不能使用任何Calendar API调用直接搜索参与者。

但是,您可以通过代码来实现。如果您写的电子邮件与参加者中的电子邮件重合,则必须列出所有事件,循环浏览它们并过滤事件。例如:

function searchEvents() { var calendarId = "primary"; var email = "[email protected]"; var result = Calendar.Events.list(calendarId).items; for (var i = 0; i < result.length; i++){ if (result[i].attendees != undefined){ //Filters out the events without attendees for (var j = 0; j < result[i].attendees.length; j++){ if (result[i].attendees[j].email == email){ Logger.log(result[i]); //It returns all the event information } } } } }

返回完整资源对象:

{ "kind": "calendar#calendarListEntry", "etag": etag, "id": string, "summary": string, "description": string, "location": string, "timeZone": string, "summaryOverride": string, "colorId": string, "backgroundColor": string, "foregroundColor": string, "hidden": boolean, "selected": boolean, "accessRole": string, "defaultReminders": [ { "method": string, "minutes": integer } ], "notificationSettings": { "notifications": [ { "type": string, "method": string } ] }, "primary": boolean, "deleted": boolean, "conferenceProperties": { "allowedConferenceSolutionTypes": [ string ] } }

参考:

© www.soinside.com 2019 - 2024. All rights reserved.