谷歌日历thr VBA,找出为什么我得到的事件未找到错误



URL-https://developers.google.com/google-apps/calendar/

我正在使用Microsfot Internet传输控制,正在尝试发送请求使用eventID而不是entryID删除谷歌日历中的事件。

这是我用过的代码,

strURL = "https://www.google.com/accounts/ClientLogin"
strFormData = "Email=" & myEmail & "&Passwd=" & myPassword & "&source=" & mySource & 
"&service=cl"
strHeaders = "Content-Type:application/x-www-form-urlencoded"
Inet1.Execute strURL, "POST", strFormData, strHeaders
'Wait for the server response must include the authentication mode
 Responded = False
 Do Until Responded = True
   DoEvents
 Loop
'Ensure that the password is correct for Google
 If InStr(response, "BadAuthentication") Then    'If the password is not Correct
   MsgBox "Google has rejected the password. Confirm the e-mail and password and try 
   again.", vbCritical, "Error"
   Exit Sub
 End If
'Delete Event  
AuthCode = Right(response, Len(response) - InStrRev(response, "Auth=") - 4)
strURL = "https://www.google.com/calendar/feeds/default/private 
/full/NXZmcjNqM3ZpMnJuaW5hMnVocGM3bWgwbDAgaW50ZWxsaXNvZnR0ZWFtQG0"
strHeaders = "Authorization: GoogleLogin auth=" & AuthCode & _
"Content-Type:application/atom+xml"
Responded = False
Inet1.Execute strURL, "Delete", "", strHeaders
Do Until Responded = True
   DoEvents
Loop

但是,我得到的回复是"未找到事件"(HTTP/1.1 404未找到),但我在日历中有我在url中提供的事件ID。

我无法弄清楚为什么我得到的事件未找到错误。

您既不应该使用客户端登录,也不应该使用/feeds/url,因为两者都已弃用,后者将于今年11月关闭。如果您仍然有问题,请迁移到API v3并转发您的问题。文件位于:https://developers.google.com/google-apps/calendar

相关内容

  • 没有找到相关文章

最新更新