我正在尝试删除未来的谷歌日历事件,从它告诉你使用events.update()的docs中,我得到的最接近的是这个:
Events events = calendar.events().instances("primary", eventId).execute();
Event instance = events.getItems().get(0);
String[] recurrence = new String[]{"RRULE:UNTIL=" + new DateTime(new Date())};
instance.setRecurrence(Arrays.asList(recurrence));
calendar.events().update("primary", eventId, instance).execute();
并为我提供了以下内容:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code": 400,
"errors": [
{
"domain": "global",
"message": "Value 'k6nni7i7p54hb82p3p6eh9emg8_20180830T174500Z' in content does not agree with value 'k6nni7i7p54hb82p3p6eh9emg8'. This can happen when a value set through a parameter is inconsistent with a value set in the request.",
"reason": "invalidParameter"
}
],
"message": "Value 'k6nni7i7p54hb82p3p6eh9emg8_20180830T174500Z' in content does not agree with value 'k6nni7i7p54hb82p3p6eh9emg8'. This can happen when a value set through a parameter is inconsistent with a value set in the request."
}
如有任何帮助,将不胜感激,谢谢!
发布于 2018-08-31 19:17:56
使用Calendar API删除事件将使用events.delete。您可以使用Try-it对其进行测试。
https://stackoverflow.com/questions/52107744
复制相似问题