Google calendar api Google日历API未使用Google API Explorer删除与会者列表中的与会者
我正在尝试从Google日历事件中删除一些与会者,该事件与房间资源日历有关,同时使用API文档中的工具,使用对该日历具有管理员权限的域管理员帐户进行适当授权 我正在发送一个请求主体,从事件中删除两名与会者,API结果为200 OK,但与会者仍然存在 我已尝试添加新与会者或更新其状态,但效果正常,但无法删除该与会者 有人知道我错过了什么吗?我也尝试过通过GAS使用它,我也遇到了同样的问题,但是为了避免任何我用官方API试用工具尝试过的自编程问题,我尝试了使用GAS 请求Google calendar api Google日历API未使用Google API Explorer删除与会者列表中的与会者,google-calendar-api,Google Calendar Api,我正在尝试从Google日历事件中删除一些与会者,该事件与房间资源日历有关,同时使用API文档中的工具,使用对该日历具有管理员权限的域管理员帐户进行适当授权 我正在发送一个请求主体,从事件中删除两名与会者,API结果为200 OK,但与会者仍然存在 我已尝试添加新与会者或更新其状态,但效果正常,但无法删除该与会者 有人知道我错过了什么吗?我也尝试过通过GAS使用它,我也遇到了同样的问题,但是为了避免任何我用官方API试用工具尝试过的自编程问题,我尝试了使用GAS 请求 PATCH https:/
PATCH
https://www.googleapis.com/calendar/v3/calendars/supportworld.com.ar_34373XXXXXXXXXXX2%40resource.calendar.google.com/events/osrd3lXXXXXXXolks?fields=attendees%2Cid&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.bwAXXXXXXXXJOeCUAAADDYWT-QXXXXXXXXXXrc_eGP6Lk7CXXXXXXXXJ6130__ci_-_YXXXXxs
X-JavaScript-User-Agent: Google APIs Explorer
{
"attendees": [
{
"organizer": true,
"email": "xxxxx@netuxxxxxxrp.com",
"responseStatus": "accepted",
"displayName": "AAAAAAA"
},
{
"self": true,
"resource": true,
"email": "supportworld.com.ar_34373XXXXXXXXXXX2@resource.calendar.google.com",
"responseStatus": "accepted",
"displayName": "Cafetera"
}
],
"id": "osrd3lXXXXXXXolks
"
}
响应
200 OK
cache-control: no-cache, no-store, max-age=0, must-revalidate
content-encoding: gzip
content-length: 294
content-type: application/json; charset=UTF-8
date: Thu, 28 Aug 2014 16:15:06 GMT
etag: "XXXXXXXXX"
expires: Fri, 01 Jan 1990 00:00:00 GMT
pragma: no-cache
server: GSE
{
"id": "osrd3lids0gkoeaggp2c95olks",
"attendees": [
{
"email": "xxxxx@netuxxxxxxrp.com",
"displayName": "AAAAAAA",
"organizer": true,
"responseStatus": "accepted"
},
{
"email": "yyyyy@netuxxxxxxrp.com",
"displayName": "YYYYYYY",
"responseStatus": "accepted"
},
{
"email": "zzzzz@netuxxxxxxrp.com",
"displayName": "BBBBBB",
"responseStatus": "needsAction"
},
{
"email": "supportworld.com.ar_34373XXXXXXXXXXX2@resource.calendar.google.com",
"displayName": "Cafetera",
"self": true,
"resource": true,
"responseStatus": "accepted"
}
]
}
参赛作品:
{
"email": "yyyyy@netuxxxxxxrp.com",
"displayName": "YYYYYYY",
"responseStatus": "accepted"
},
{
"email": "zzzzz@netuxxxxxxrp.com",
"displayName": "BBBBBB",
"responseStatus": "needsAction"
}
不应该再在那里了,但是他们。。对此任何帮助都表示感谢,我能够让它工作。我认为API资源管理器工具有问题 具体来说,在指定补丁正文的地方,有一个结构化编辑器,通过它可以添加和删除Attendeers对象的JSON部分。当我使用结构化编辑器从列表中删除一名与会者,然后切换到自由形式编辑器时,该与会者仍然存在。臭虫 在freeform编辑器中,我再次删除了所需的attendee块并执行了它,一切都按它应该的方式运行。我在一个单独的标签页上用GET验证了与会者确实被删除了 (要访问不同的编辑器,在补丁正文文本字段的右上角有一个下拉按钮。)我用C#编写了它,我想在其他语言中也会用同样的方式编写 当我试图从列表中删除不需要的与会者时,它没有起作用
eventItem.Attendees.Remove(new EventAttendee { Email = "<to be removed>@gmail.com" });
eventItem.Attendees = eventItem.Attendees.Where(a => a.Email != "<to be removed>@gmail.com").ToList();
service.Events.Patch(eventItem, "primary", eventItem.Id).Execute();