當日歷中創建新活動時,我成功地將Google日曆中的推送通知導入到我的系統中。 推送通知在POST身體已經沒有數據和POST頭是這些:如何從Google日曆中獲取活動詳情
[Host] => xxxxxx.xxxx.com
[Content-Type] => application/json; charset=UTF-8
[Accept] => */*
[X-Goog-Channel-ID] => xxxxxxx-xxxxxxxx-8824-f0c2166878be
[X-Goog-Channel-Expiration] => Thu, 04 Dec 2014 04:27:13 GMT
[X-Goog-Resource-State] => exists
[X-Goog-Message-Number] => 11897215
[X-Goog-Resource-ID] => xxxxxxxxxx-xxxx-pSbC27qOUfg
[X-Goog-Resource-URI] => https://www.googleapis.com/calendar/v3/calendars/[email protected]/events?key=AIzaSyC_0nytiZWHfabrpWiExxxxxxxxxxx&alt=json
[Content-Length] => 0
[Connection] => Keep-alive
[Accept-Encoding] => gzip,deflate
[User-Agent] => APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html)
哪裏是在日曆中創建的新事件的詳細信息? 我如何得到它們?
網上信息和谷歌文檔中的任何信息(一直在尋找小時): https://developers.google.com/google-apps/calendar/v3/push
到哪裏都是在事件的詳細信息?
UPDATE:
我使用此代碼設置我的日曆的手錶:
service = new Google_Service_Calendar($client);
$channel = new Google_Service_Calendar_Channel($client);
$uuid = gen_uuid();
$channel->setId($uuid);
$channel->setType('web_hook');
$channel->setExpiration('1919995862000');
global $sugar_config;
$address = $sugar_config['site_url'] . "/index.php?entryPoint=updateFromCal";
$channel->setAddress($address);
$watchEvent = $service->events->watch($bean->google_cal_id_c, $channel);
這是通道的細節我發送給谷歌日曆API:
[address] => https://mydomainXXXX/index.php?entryPoint=updateFromCal
[expiration] => 1919995862000
[id] => xxxxxxxxxxxxxxx--4558-ac19-b82e0ca32206
[kind] =>
[params] =>
[payload] =>
[resourceId] =>
[resourceUri] =>
[token] =>
[type] => web_hook
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
我仍然會在響應中獲得相同的資源ID,並在日曆中創建每個新事件!爲什麼我無法獲得剛剛創建的事件的事件ID?我做錯了什麼?我在看事件或頻道嗎?
我得到的答覆仍然是上面提到的答覆,它始終具有相同的資源ID。
我是否應該在推送通知本身中接收觸發推送通知的事件詳細信息?如果不是,我怎麼知道哪個事件改變觸發了它? – Rodniko 2014-11-04 17:49:43
@rodnika不幸的沒有。請參閱下面的答案。總之,你需要做一個同步來獲得改變的事件。 – FullStack 2015-04-06 04:21:55
http:// stackoverflow可能存在重複。com/questions/18308751/response-from-google-regard-push-notification/ – FullStack 2015-04-06 04:22:37