我使用以下代码为Google日历观看事件创建了一个新频道,但在从Google收到webhook时未在标题中获取任何数据。
client = Google::APIClient.new
client.authorization.access_token = "#{access_token}"
service = client.discovered_api('calendar', 'v3')
data = client.execute api_method: service.events.watch, parameters: {
calendarId: "primary",
}, body_object: {
id: "34234234-89ab-cdef-0123456789ab",
type: "web_hook",
address: "#{my_domain}/notifications"
}