Tag: google calendar api

有没有人知道任何与从Rails应用程序向iCal,Google Calendar,Outlook导出事件相关的gem/插件/教程?

我想弄清楚是否已经插入了与iCal的交互,我可以使用的Google API,或者我需要自己动手并自己编写。 如果有人知道我可以看到的好资源可以帮助我实现,那也会很好。 我是RoR的新手,我一直试图学习它。 我终于决定开始玩我自己的应用程序,而不仅仅是关注一本书。 任何有关此事的帮助将不胜感激。 谢谢!

如何在Ruby中为Google Calendar API授权服务帐户?

如何在Ruby中为Google Calendar API授权服务帐户? 我尝试了快速入门指南,但它崩溃了。 https://developers.google.com/calendar/quickstart/ruby#step_3_set_up_the_sample quickstart.rb require ‘google/apis/calendar_v3’ require ‘googleauth’ require ‘googleauth/stores/file_token_store’ require ‘fileutils’ OOB_URI = ‘urn:ietf:wg:oauth:2.0:oob’.freeze APPLICATION_NAME = ‘Google Calendar API Ruby Quickstart’.freeze CLIENT_SECRETS_PATH = ‘client_secrets.json’.freeze CREDENTIALS_PATH = ‘token.yaml’.freeze SCOPE = Google::Apis::CalendarV3::AUTH_CALENDAR_READONLY ## # Ensure valid credentials, either by restoring from the saved credentials # files or intitiating an OAuth2 authorization. If authorization is […]

为什么Google API无论输入设置了+01偏移量?

我在此页面上使用Google的API Explorer作为其Calendar API。 我正在插入一个事件{ “end”: { “dateTime”: “2016-10-31T06:30:00Z” }, “start”: { “dateTime”: “2016-10-31T06:00:00Z” } }并尝试了以下日期时间格式: 2016-10-31T06:00:00Z 2016-10-31T06:00:00-00:00 2016-10-31T06:00:00+00:00 但无论输入格式如何,Google都会选择在设置日期时间时添加一小时。 响应总是: “start”: { “dateTime”: “2016-10-31T07:00:00+01:00” } 我目前在斯德哥尔摩,抵消时间+2小时。 我已经尝试设置单独的time_zone字段并省略单独的time_zone字段。 为什么会这样? 并且,有没有“正确的方法”或者我只是需要在设定时间时考虑这个额外的小时?

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 […]

未创建Rails + Google Calendar API事件

我创建了rails web app。 当用户执行某些操作时,我的应用必须在Google日历中创建新活动。 对于我的任务,我选择服务器到服务器授权。 我写了下一个ruby代码: client = Google::APIClient.new({:application_name => “Rails calendar”, :application_version => “1.0”}) keypath = Rails.root.join(‘config’,’google_secrets.p12′).to_s key = Google::APIClient::PKCS12.load_key(keypath, “notasecret”) # generate request body for authorization client.authorization = Signet::OAuth2::Client.new( :token_credential_uri => ‘https://accounts.google.com/o/oauth2/token’, :audience => ‘https://accounts.google.com/o/oauth2/token’, :scope => ‘https://www.googleapis.com/auth/calendar’, :issuer => ‘***’, :signing_key => key).tap{ |auth| auth.fetch_access_token! } api_method = client.discovered_api(‘calendar’,’v3′).events.insert @meeting_data = { […]

服务器上未收到日历事件通知

我正在尝试观看谷歌日历活动。 我写了这段代码: def watch_calendar_event result = @client.execute( api_method: @calendar_api.events.watch, parameters: { calendarId: ‘primary’ }, body_object: watch_hash, headers: {‘Content-Type’ => ‘application/json’} ) if result.status == 200 watch_data = result.data @calendar.update booking_expiration: watch_data.expiration, booking_id: watch_data.id, booking_resource_id: watch_data.resourceId, booking_resource_uri: watch_data.resourceUri, watching_event: true end rescue Exception => ex raise GoogleCalendarException, ex.message end 我正在获得200条成功消息,其中包括booking_id,resource_id和resourceUri等其他详细信息。 但是当我在谷歌日历上创建一个新事件时,我没有在我的服务器上收到任何通知。 任何想法可能是什么原因。 另请注意,我已经完成了他们在此处提出的所有问题,并且我还为此配置了https服务器。 我的webhookurl如下: https ://dev.application.com/notifications我也为此打开了路线。 […]