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 WordPress community. Analytify is a one kind of WordPress plugin which uses Google Analytics APIs heavily and simplifying the life of data lovers in WordPress. It displays all the actionable Analytics in one dashboard and show you Analytics page by page. So, I have decided to start a series of blog posts on Google Drive APIs in which I will walk you through some interesting things of the Drive SDK. I will take you from the scratch and reach at a point where you will have a good knowledge of Drive SDK and can use it in your future web apps. If this series helps you in any way, shoot out and Share it with your friends .
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 using it since then.
If you want to know more about (after watching above video) Google Drive. I recommend to watch couple of these videos at youtube.
Google Drive APIs Overview
I assume you have a beginner level of knowledge of any programming language. Google Drive platform provides client libraries of all the popular languages like .Net, PHP, JS, Node.js, iOS and Android. However, I will use PHP client library in this course as I am a PHP guy and building Web Apps in PHP since years. We have documentation of Drive SDK which helps us develop apps that integrate with Drive. You know Google Drive is a platform where you can only upload and download files and thinks that 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 !!
Before you install PHP Client library, you should confirm that running PHP version on your machine is greater or equal than 5.3.2 with JSON extension enabled. Normally, JSON extension is already enabled in packages.
Download the latest (zip file) release from Google Drive github repository and unzip it in your machine. I recommend to use git version control to manage your code. If you are familiar with git then use the below command and clone master branch like this
So, you got the library files in your machine. When you unzip or clone the php client library, It will be a folder google-api-php-client and 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 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 here. You just need to Enable the Drive API instead of Analytics API as you are going to use this project for Drive Apps.
So, there were 2 steps today.
- Create Project in Google Console.
That’s enough for today. In next part, we will start writing a script and use settings of Google Project console in our code.