When I was living my life as a Google Student Ambassador in 2013-2014, I spread the goodness of Google Drive in many of my events. I fell in love with Google Drive and have been using it since then.
Analytify is a WordPress plugin that heavily leverages Google Analytics APIs and simplifies the lives of data lovers in WordPress. It displays all actionable Analytics in a single dashboard and shows them page by page.
Hello developers! I know this is something other than WordPress at WPBrigade, but we can’t forget the importance and usage of Google Apps in the WordPress community.
So, I have decided to start a series of blog posts on Google Drive APIs, where I will walk you through some interesting features of the Drive SDK.
I will take you from scratch to a point where you have a good understanding of the Drive SDK and can use it in your future web apps. If this series helps you in any way, shoot it out and share it with your friends, and there is no reason not to take an interest in learning Google Drive APIs, as its usage is totally free.
Google Drive API Overview
I assume you have a basic knowledge of any programming language. Google Drive platform provides client libraries of all the popular languages, such as .NET, PHP, JS, Node.js, iOS, and Android. However, I will use the PHP client library in this course as I am a PHP guy and have been building Web Apps in PHP for years. We have documentation of the Drive SDK, which helps us develop apps that integrate with Drive. You know Google Drive is a platform for uploading and downloading files, and you think it is only for storage? Well! After finishing this course, you will be amazed that you can even make money from these apps.
Ok Ok, be patient, let’s start our Journey !!
Installation
Before you install the PHP Client library, you should confirm that the running PHP version on your machine is greater than or equal to 5.3.2 with the JSON extension enabled. By default, the JSON extension is enabled in packages.
Download the latest (zip file) release from the Google Drive GitHub repository and unzip it on your machine. I recommend using git version control to manage your code. If you are familiar with Git, then use the below command and clone the master branch like this
git clone https://github.com/google/google-api-php-client/
So, you got the library files on your machine. When you unzip or clone the PHP client library, It will be a folder google-API-PHP-client and the file structure will be

If you open /examples/ folder in your browser and try to run any example, you will see a warning message.
Warning: You need to set Client ID, Client Secret, and Redirect URI from the Google API console
Create a Project in Google Console
Yes, it is necessary to create a project in Google Console and set Client ID, Client Secret, and Redirect URI in your code. I have written a detailed tutorial on how to get Client ID, Client Secret, and API Key from Google Developers Console. You just need to enable the Drive API instead of the Analytics API, since you’ll be using this project for Drive Apps.
So, there were 2 steps today.
- Installation
- Create a Project in Google Console.
That is it for today. In the next part, we will start writing a script and use the settings of the Google Project console in our code.

Leave a Reply