Ruby Google Calendar Integration观看事件/推送通知
以下代码片段打印日历ID的事件,配置了所有日历并尝试在日历上设置观看通知。
一切都有效但手表事件方法。 我收到此错误:apis / core / http_command.rb:212:在`check_status’中:未经授权(Google :: Apis :: AuthorizationError)
这个看起来很奇怪,因为日历和事件检索工作正常。
service = Google::Apis::CalendarV3::CalendarService.new service.client_options.application_name = APPLICATION_NAME service.authorization = authorize # Fetch the next 10 events for the user calendar_id = 'us7i4kt2to4mpb0b5et1f9f4co@group.calendar.google.com' response = service.list_events(calendar_id, max_results: 10, single_events: true, order_by: 'startTime', time_min: Time.now.iso8601) puts "Upcoming events:" puts "No upcoming events found" if response.items.empty? response.items.each do |event| start = event.start.date || event.start.date_time puts "- #{event.summary} (#{start})" end @calendar_list = service.list_calendar_lists @calendar_list.items.each do |calendar| puts " #{calendar.summary} => #{calendar.id}" end channel = Google::Apis::CalendarV3::Channel.new(address: 'https://66724be7.ngrok.io', id: 100, type: "web_hook") puts "Channel created " webhook = service.watch_event('us7i4kt2to4mpb0b5et1f9f4co@group.calendar.google.com', channel, single_events: true, time_min: Time.now.iso8601)
我收到此错误:apis / core / http_command.rb:212:在`check_status’中:未经授权(Google :: Apis :: AuthorizationError)
在网上找不到任何相关内容
- 如何使用OAuth 2.0为Ruby中的google预测API进行授权?
- 如何从Google People API中删除contact_groups
- 如何从服务帐户谷歌驱动器api下载文件?
- 在Google云端硬盘API中接收错误403 – 超出未经身份validation的使用的每日限制。 继续使用需要注册
- 为什么Google API无论输入设置了+01偏移量?
- cron crawler使用Ruby中的Google API将数据插入Google电子表格的授权问题
- Google-api-client要求访问令牌
- 未创建Rails + Google Calendar API事件
- Rails中的plusAPmains.circles.addPeople的Google API生成403 Forbidden