{"id":8230,"date":"2019-12-05T10:54:44","date_gmt":"2019-12-05T05:24:44","guid":{"rendered":"https:\/\/www.botreetechnologies.com\/blog\/?p=8230"},"modified":"2021-09-13T18:00:18","modified_gmt":"2021-09-13T12:30:18","slug":"how-to-create-events-in-google-calendar-from-ruby-on-rails-application","status":"publish","type":"post","link":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/","title":{"rendered":"How to Create Events in Google Calendar using Ruby on Rails?"},"content":{"rendered":"\n<p>In many cases, we need to create events in a calendar app from web applications. For example, create an appointment with Doctors or schedule service with plumbers.<\/p>\n\n\n\n<p>Google Calendar is the most used app for scheduling and it&#8217;s very popular among business people. We are building an app that needs to create an appointment with therapists\u2019 google calendar.<\/p>\n\n\n\n<p>Let\u2019s see how it is easy to integrate the Google Calendar in a Rails application using <a href=\"https:\/\/github.com\/zquestz\/omniauth-google-oauth2\" target=\"_blank\" rel=\"noopener noreferrer\">omniauth-google-oauth2<\/a> and <a href=\"https:\/\/github.com\/googleapis\/google-api-ruby-client\" target=\"_blank\" rel=\"noreferrer noopener\">google-api-client<\/a> gems with Google OAuth 2.0 mechanism.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Ruby 2.x<\/li><li>Rails 4.x +<\/li><li>Google Account<\/li><\/ul>\n\n\n\n<p>We will need the Google <code>client_id<\/code> and <code>client_secret<\/code> to securely authenticate all the API requests from our app to Google Calendar. Let\u2019s create one for the demo.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup Google API Project<\/h2>\n\n\n\n<p><strong>Step 1 &#8211; Create a new Project<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Sign in to <a href=\"https:\/\/console.developers.google.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Google API console<\/a>.<\/li><li>Click on <strong>Create a new project<\/strong> and enter a name for the project<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"457\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-1.png\" alt=\"Google Calendar API 1\" class=\"wp-image-13367\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-1.png 878w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-1-300x156.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-1-768x400.png 768w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Search for the Google Calendar API on the Library page and then click the <code>ENABLE<\/code> button on the API view.<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"272\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-2.png\" alt=\"Google Calendar API 2\" class=\"wp-image-13368\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-2.png 730w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-2-300x112.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Step 2 &#8211; Create client credentials (client_id and client_secreet)<\/strong><\/p>\n\n\n\n<p>Now, create `client_id` and `client_secret` for your application.<\/p>\n\n\n\n<p>Click on the <strong>\u2018Credentials\u2019<\/strong> in the left panel. Select the <strong>\u2018OAuth client ID\u2019<\/strong> option as seen below.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"422\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-3.png\" alt=\"Google Calendar API 3\" class=\"wp-image-13369\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-3.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-3-300x124.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-3-768x317.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>It will prompt you to configure the consent screen. Click on <strong>\u2018Configure consent screen\u2019<\/strong> button<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"263\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-4.png\" alt=\"Google Calendar API 4\" class=\"wp-image-13370\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-4.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-4-300x77.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-4-768x197.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Step 3 &#8211; Create OAuth consent screen<\/strong><\/p>\n\n\n\n<p>Fill up the form and add the <strong>scopes<\/strong> based on the requirement. Here we need to access the calendar and events. So, select the calendar-related scops only. See it in the below screens.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-5.png\" alt=\"Google Calendar API 5\" class=\"wp-image-13371\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-5.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-5-300x136.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-5-768x349.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"424\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-6.png\" alt=\"Google Calendar API 6\" class=\"wp-image-13372\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-6.png 1024w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-6-300x124.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-6-768x318.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>Click on the <strong>Save<\/strong> button.<\/p>\n\n\n\n<p>It will generate and display the popup with <strong>client id<\/strong> and <strong>client secret<\/strong>. Copy and paste it somewhere. We will need it for authentication in our Rails app.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Read Also: <a href=\"https:\/\/www.botreetechnologies.com\/blog\/google-api-authorization-with-ruby-using-long-lasting-refresh-token\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google API Authorization with Ruby using long lasting Refresh Token<\/a><\/p><\/blockquote>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"200\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-7.png\" alt=\"Google Calendar API 7\" class=\"wp-image-13373\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-7.png 779w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-7-300x77.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-7-768x197.png 768w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Step &#8211; 4 &#8211; Configure the Redirect URL (Call back URL)<\/strong><\/p>\n\n\n\n<p>The redirect URI may change based on your application root url.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Authorized JavaScript origins: https:\/\/YOUR_NAMESPACE<\/li><li>Authorized redirect URI: https:\/\/YOUR_NAMESPACE\/users\/google_oauth2\/callback<\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"521\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-8.png\" alt=\"Google Calendar API 8\" class=\"wp-image-13374\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-8.png 650w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-8-300x240.png 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure><\/div>\n\n\n\n<p>This completes configuration at Google\u2019s end. Now, let\u2019s jump into the <a href=\"https:\/\/www.botreetechnologies.com\/blog\/authenticate-using-stormpath-in-a-ruby-on-rails-application\/\" target=\"_blank\" rel=\"noreferrer noopener\">Rails app<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Authenticate Users with Devise and Google OmniAuth<\/h3>\n\n\n\n<p><strong>Step 1 &#8211; Install Gems<\/strong><\/p>\n\n\n\n<p>Add the following gems in `Gemfile` and `bundle`<\/p>\n\n\n\n<p><code># Gemfile<\/code><\/p>\n\n\n\n<p><code>gem \u2018devise\u2019<\/code><\/p>\n\n\n\n<p><code>gem \u2018omniauth-google-oauth2\u2019<\/code><\/p>\n\n\n\n<p><strong>Step 2 &#8211; Configure OAuth credentials<\/strong><\/p>\n\n\n\n<p>Add below code snippet In your <code>config\/initializers\/devise.rb<\/code> file and replace project `client_id` and `client_secret` as you collected above from Google Account. Don\u2019t forget to add the scope &#8211; `userinfo.email, calendar`.<\/p>\n\n\n\n<p><code>config.omniauth :google_oauth2, ENV['GOOGLE_CLIENT_ID'], ENV['GOOGLE_CLIENT_SECRET'],<\/code><\/p>\n\n\n\n<p><code>{<\/code><\/p>\n\n\n\n<p><code>access_type: \"offline\",<\/code><\/p>\n\n\n\n<p><code>prompt: \"consent\",<\/code><\/p>\n\n\n\n<p><code>select_account: true,<\/code><\/p>\n\n\n\n<p><code>scope: 'userinfo.email, calendar'<\/code><\/p>\n\n\n\n<p><code>}<\/code><\/p>\n\n\n\n<p>There are a couple of important things to note here:<\/p>\n\n\n\n<p>In order for Google to send us back not only an access token but a refresh token, we need to specify a few options:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><code>prompt: \"consent\"<\/code><\/li><li><code>access_type: \"offline\"<\/code><\/li><\/ol>\n\n\n\n<p>We also need to include a calendar in the scope, so that we can interact with the Google Calendar API later on.<\/p>\n\n\n\n<p><strong>Step 3 &#8211; Add User Authentication and Callback<\/strong><\/p>\n\n\n\n<p>First <strong>run rails g devise:install<\/strong>, It will prepare your rails app for authentication and adds following routes to the <strong>routes.rb<\/strong>.<\/p>\n\n\n\n<p><code>Rails.application.routes.draw do<\/code><\/p>\n\n\n\n<p><code>devise_for :users<\/code><\/p>\n\n\n\n<p><code>end<\/code><\/p>\n\n\n\n<p>But you need to customize the routes for the specific controller which should be used as the callback controller.<\/p>\n\n\n\n<p><code>Rails.application.routes.draw do<\/code><\/p>\n\n\n\n<p><code>devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; \"callbacks\" }<\/code><\/p>\n\n\n\n<p><code>End<\/code><\/p>\n\n\n\n<p><strong>Steps 4 &#8211; Define the callback controller<\/strong><\/p>\n\n\n\n<p>Your callback controller needs to inherit from the `Devise::OmniauthCallbacksController`. Take a look<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/ee720582fc89c49cf64be5222704e690.js\"><\/script><\/p>\n\n\n\n<p><strong>User Model<\/strong><\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/a2f50f5230d8358cdbbce86d72dc90c7.js\"><\/script><\/p>\n\n\n\n<p><strong>Step 5 &#8211; Add &#8220;Sign In with Google&#8221; Link<\/strong><\/p>\n\n\n\n<p>Use the following snippet to add Sign In with Google link which will take the user to google for authentication<\/p>\n\n\n\n<p>`&lt;%= link_to &#8220;Sign in with Google&#8221;, user_google_oauth2_omniauth_authorize_path %&gt;`<\/p>\n\n\n\n<p><strong>Step 6 &#8211; Add additional columns to store tokens<\/strong><\/p>\n\n\n\n<p>Add below columns to the User to store the authentication details to check the logged in user and use these tokens for the API calls.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/810afbe6e469a654a96740ba5519fb3f.js\"><\/script><\/p>\n\n\n\n<p><strong>Step 7 &#8211; Add the Google API Ruby Client gem<\/strong><\/p>\n\n\n\n<p>Now, it\u2019s time for the final steps to create a new calendar event using Google API Ruby Client with the Google Calendar API. Add&nbsp; \u2018google-api-client to Gemfile and \u2018bundle install\u2019<\/p>\n\n\n\n<p>gem &#8216;google-api-client&#8217;, require: &#8216;google\/apis\/calendar_v3&#8217;<\/p>\n\n\n\n<p><strong>Step 8 &#8211; Add \u2018Task\u2019 model<\/strong><\/p>\n\n\n\n<p>Create a `Task` model to save all events locally as well and it\u2019s migration with below columns. The migration should look like<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/d9f192b1e16d8dbfae44d089b72a9687.js\"><\/script><\/p>\n\n\n\n<p>Run `rake db:migrate` to create a table<\/p>\n\n\n\n<p><strong>Step 9 &#8211; Configure routes<\/strong><\/p>\n\n\n\n<p>Add following to create RESTful routes Task resource<\/p>\n\n\n\n<p>`resources :tasks`<\/p>\n\n\n\n<p>Step 10 &#8211; Handle calendar event creation in Controller<\/p>\n\n\n\n<p>Here is a working controller code to add an event to the Google calendar with API by passing the event hash.<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/2b86cd4753ceb40491e91c58600466ca.js\"><\/script><\/p>\n\n\n\n<p>Start the rails server if not running<\/p>\n\n\n\n<p><strong>Step 10 &#8211; Sign in to get access codes<\/strong><\/p>\n\n\n\n<p>Go to that page where you added the <strong>Sign In with Google (Step 5)<\/strong> link and click it. If everything is configured correctly you should see the Google consent screen requesting access to create an event in the calendar.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"609\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-9.png\" alt=\"Google Calendar API 9\" class=\"wp-image-13375\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-9.png 450w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-9-222x300.png 222w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n\n<p>If you allow access then you\u2019ll be redirected back to the callback action with a temporary authorization code and update the latest `access_token` and `refresh_token`. Check the controller code to see where exactly the codes are required<\/p>\n\n\n\n<p><strong>Step 11 &#8211; Render `new` event View<\/strong><\/p>\n\n\n\n<p>Here is the `new.html.erb` view file to render a form to create a new event. Put it under views\/tasks`<\/p>\n\n\n\n<p><script src=\"https:\/\/gist.github.com\/ParthivPatel-BTC\/b1cf2cc9c81da0638496681c4b6e9dd2.js\"><\/script><\/p>\n\n\n\n<p>You should see below form when you access it `http:\/\/&lt;host&gt;:&lt;port&gt;\/task\/new` in browser<\/p>\n\n\n\n<p>Once you click on the Create Task button, the new calendar event would be created in your Google calendar. Like this.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"462\" height=\"482\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-10.png\" alt=\"Google Calendar API 10\" class=\"wp-image-13376\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-10.png 462w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-10-288x300.png 288w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/figure><\/div>\n\n\n\n<p>You should see above event created in Google Calendar like<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"544\" src=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-11.png\" alt=\"Google Calendar API 11\" class=\"wp-image-13377\" srcset=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-11.png 823w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-11-300x198.png 300w, https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/12\/google-calendar-api-11-768x508.png 768w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/figure><\/div>\n\n\n\n<p>That&#8217;s it. Hope this helped you to learn about <a href=\"https:\/\/www.botreetechnologies.com\/blog\/spread-sheet-basic-operations-with-google-api-and-ruby\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google API integration<\/a>.<\/p>\n\n\n\n<p>Thanks for reading!<\/p>\n\n\n\n<p><a href=\"https:\/\/www.botreetechnologies.com\/ruby-on-rails-development\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Click here for more details&#8230;<\/strong><\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a href=\"https:\/\/www.botreetechnologies.com\/contact\" target=\"_blank\" rel=\"noopener noreferrer\">Consulting is free<\/a> &#8211; let us help you grow!<\/h3>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In many cases, we need to create events in a&#8230;<\/p>\n","protected":false},"author":11,"featured_media":13366,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,10],"tags":[],"class_list":["post-8230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-on-rails","category-technology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create Events in Google Calendar using Ruby on Rails?<\/title>\n<meta name=\"description\" content=\"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create Events in Google Calendar using Ruby on Rails?\" \/>\n<meta property=\"og:description\" content=\"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\" \/>\n<meta property=\"og:site_name\" content=\"BoTree Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BoTreeTechnologies\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-05T05:24:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-13T12:30:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Parthiv Patel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:site\" content=\"@BoTreeTech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Parthiv Patel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\"},\"author\":{\"name\":\"Parthiv Patel\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3\"},\"headline\":\"How to Create Events in Google Calendar using Ruby on Rails?\",\"datePublished\":\"2019-12-05T05:24:44+00:00\",\"dateModified\":\"2021-09-13T12:30:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\"},\"wordCount\":950,\"commentCount\":13,\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg\",\"articleSection\":[\"Ruby on Rails\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\",\"name\":\"How to Create Events in Google Calendar using Ruby on Rails?\",\"isPartOf\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg\",\"datePublished\":\"2019-12-05T05:24:44+00:00\",\"dateModified\":\"2021-09-13T12:30:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3\"},\"description\":\"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg\",\"width\":1920,\"height\":1280,\"caption\":\"Google Calendar from Ruby On Rails Application\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.botreetechnologies.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create Events in Google Calendar using Ruby on Rails?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#website\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/\",\"name\":\"BoTree Technologies\",\"description\":\"Committed to inspire generation.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3\",\"name\":\"Parthiv Patel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png\",\"url\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png\",\"contentUrl\":\"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png\",\"caption\":\"Parthiv Patel\"},\"description\":\"Parthiv is a Ruby on Rails Engineer. He has strong experience in javascript and DevOps activities like deployment, installation, server, and domain configuration, maintenance, and support of any platform like AWS, digital ocean and Heroku. He develops applications with optimization and clean code with full Rspec coverage.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create Events in Google Calendar using Ruby on Rails?","description":"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/","og_locale":"en_US","og_type":"article","og_title":"How to Create Events in Google Calendar using Ruby on Rails?","og_description":"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.","og_url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/","og_site_name":"BoTree Technologies","article_publisher":"https:\/\/www.facebook.com\/BoTreeTechnologies\/","article_published_time":"2019-12-05T05:24:44+00:00","article_modified_time":"2021-09-13T12:30:18+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg","type":"image\/jpeg"}],"author":"Parthiv Patel","twitter_card":"summary_large_image","twitter_creator":"@BoTreeTech","twitter_site":"@BoTreeTech","twitter_misc":{"Written by":"Parthiv Patel","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#article","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/"},"author":{"name":"Parthiv Patel","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3"},"headline":"How to Create Events in Google Calendar using Ruby on Rails?","datePublished":"2019-12-05T05:24:44+00:00","dateModified":"2021-09-13T12:30:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/"},"wordCount":950,"commentCount":13,"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg","articleSection":["Ruby on Rails","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/","url":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/","name":"How to Create Events in Google Calendar using Ruby on Rails?","isPartOf":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage"},"image":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage"},"thumbnailUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg","datePublished":"2019-12-05T05:24:44+00:00","dateModified":"2021-09-13T12:30:18+00:00","author":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3"},"description":"Wondering how to create events in Google Calendar using a Ruby on Rails? Here\u2019s a simple guide comprising of the steps to do the same.","breadcrumb":{"@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#primaryimage","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2019\/12\/google-calendar-from-ruby-on-rails-application.jpg","width":1920,"height":1280,"caption":"Google Calendar from Ruby On Rails Application"},{"@type":"BreadcrumbList","@id":"https:\/\/www.botreetechnologies.com\/blog\/how-to-create-events-in-google-calendar-from-ruby-on-rails-application\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.botreetechnologies.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create Events in Google Calendar using Ruby on Rails?"}]},{"@type":"WebSite","@id":"https:\/\/www.botreetechnologies.com\/blog\/#website","url":"https:\/\/www.botreetechnologies.com\/blog\/","name":"BoTree Technologies","description":"Committed to inspire generation.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.botreetechnologies.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.botreetechnologies.com\/blog\/#\/schema\/person\/33421652a86a8f62aa02d78c35b1f3c3","name":"Parthiv Patel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png","url":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png","contentUrl":"https:\/\/www.botreetechnologies.com\/blog\/wp-content\/uploads\/2020\/10\/parthiv-patel-150x150.png","caption":"Parthiv Patel"},"description":"Parthiv is a Ruby on Rails Engineer. He has strong experience in javascript and DevOps activities like deployment, installation, server, and domain configuration, maintenance, and support of any platform like AWS, digital ocean and Heroku. He develops applications with optimization and clean code with full Rspec coverage."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=8230"}],"version-history":[{"count":3,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8230\/revisions"}],"predecessor-version":[{"id":16300,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/8230\/revisions\/16300"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media\/13366"}],"wp:attachment":[{"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=8230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=8230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.botreetechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=8230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}