我遇到了Google Calendar API的问题。我正在创建一个新频道来接收通知。以下是Guzzle和Google客户端创建的请求以及成功的订阅响应:
POST /calendar/v3/calendars/info@mycalendaremail.com/events/watch HTTP/1.1
Host: www.googleapis.com
User-Agent: Guzzle/5.3.1 curl/7.49.1 PHP/7.1.1
Content-Type: application/json
{"id":"nctest-827009","type":"web_hook","address":"https:\/\/f7487d73.ngrok.io\/api\/catch-google-calendar-notification","expiration":"1510133420000"}
POST /oauth2/v4/token HTTP/1.1
Host: www.googleapis.com
Cache-Control: no-store
Content-Type: application/x-www-form-urlencoded
User-Agent: Guzzle/5.3.1 curl/7.49.1 PHP/7.1.1
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJuYWtlZGNhcnBldUNAbmMtY2FsZW2kYXItMTg0MzA2LmlhbS5nc2VydmljZWFjY291bnQuY29tIiwiYXVkIjoiaHR0cHM6XC9cL3d3dy5nb29nbGVhcGlzLmNvbVwvb2F1dGgyXC92NFwvdG9rZW4iLCJleHAiOjE1MDk1Mjg2MjAsImlhdCI6MTUwOTUyNDk2MCwic7NvcGUiOiJodHRwczpcL1wvd3d3Lmdvb2dsZWFwaXMuY29tFC9hdXRoXC9jYWxlbmRhciJ9.T5Jqz1sSsBHKqSDTQIVK79CJQOVaXvlD89UwURguz83wq-Z6fMEKnys-1ICOmRfv0l3mrOb-Xu44RuoA5JcBAipQh0U_Pd99hQFI-723ff98JWggSwhSz1iz-tpKDEqih8YSE8LltGUwfj94_tkip-bLUyqJwOgCbGkh3KfMQdRGAwjxSipmy72VzePCO2qfMs7z77H7PTD_CynkISbuRB_EYyjgXfGoFE8-nFFjBZ7lRdueHejyMXxNCaV0uSf9N_7BcrAa6uyY-7_a60qo4yoVeZNg5I_62zgQc0BZiJQywIEcrTm9LGPm14WaPkKQa4Kpxa4ymbLwmVnEjwCaxQ
{
"kind": "api#channel",
"id": "nctest-827009",
"resourceId": "rRZHlhKrOO9wkcNdNFIBOZsUjHg",
"resourceUri": "https://www.googleapis.com/calendar/v3/calendars/info@mycalendaremail.com/events?maxResults=250&alt=json",
"expiration": "1510133420000"
}
当我尝试使用新创建的日历完全相同时,它可以完美地运行。我的意思是我订阅并收到通知。
使用现有日历,我正在订阅而不会收到通知。
域名是相同的。代码是一样的。服务器是一样的。
没有任何错误消息。我想知道如何才能使用现有日历?