In our last blog, we have seen how to implement authorization for google APIs with Google auth.

So now you know how to achieve authorization for using several Google APIs.

Today we will see how to use Google Drive API for basic operations on Google spreadsheet.

Here we go…

Step-1: Implement authorization by following of our reference blog,

Google API Authorization with Ruby using long lasting Refresh Token

Step-2: Now we need to enable the API to our project which we wish to use. This can be done from https://console.cloud.google.com/apis/library here.

a. Search the desired API in the list and click on it and enable it.

Google drive
Google Drive API

Now, As we are done with the authorization process, we can start operations on Google Spreadsheet.

Step-3: Performing Operations on Google Spreadsheet.

Here I will be explaining how to create Google Spreadsheet, How to read a Google Spreadsheet and how to share Google Spreadsheet with the help of Google Drive API and Ruby.

Google DriveAPI

1. Creating Google Spreadsheet.

For Creating spreadsheet with Google Drive API First we need to do authorization first which we can achieve with Step-1.

Now we have our credential hash, Let’s write some ruby code to create Google Spreadsheet.

and done, our Google Spreadsheet is created!

2. Reading Google Spreadsheet.


That’s it, Pretty simple no..!!

3. Sharing Google Spreadsheet.


This is how we can share a spreadsheet with Google Drive API and ruby.

Give it a try and Enjoy Coding..!!

Click here for more details…


At BoTree Technologies, we build enterprise applications with our RoR team of 25+ engineers.

We also specialize in RPA, AI, Python, Django, JavaScript and ReactJS.

Consulting is free – let us help you grow!