我正在访问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
参数字段列表供您过滤?但是,您可以通过代码来实现。如果您写的电子邮件与参加者中的电子邮件重合,则必须列出所有事件,循环浏览它们并过滤事件。例如:
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 ] } }
参考: