After a lot of head banging and guess work I figured it out.
Followed the instructions in here
https://github.com/google/google-api-php-client
- you don't need JSON for GAE version since it has PHP 5.4
As for install library you have to download and put "Google" folder in your code folder, so that it uploads to GAE along with your app and then include the library with the following
set_include_path(get_include_path() . PATH_SEPARATOR . 'Google/src');
Then the doc says that you need to add APP Key
$client->setDeveloperKey("YOUR_APP_KEY");
I had no idea what the APP KEY is. I keep digging into the doc and keep saying to go to the developer console. I still don't know what is an APP KEY. Now trying to wing it from the error from the browser that said invalid key setup this
That API key is what the "YOUR_APP_KEY". I really wish someone explained that to me I spent days confused and lost. It was more confusing when it said server or browser. I still don't know if I should use browser or server. It is working now so I wont trouble with it.
The getting started steps also fails to say that you need to do a require_once . I am newbie and docs need to explain step by step. I do not know what others may need but add whatever Service you need eg
require_once 'Google/Client.php';
require_once 'Google/Service/Drive.php';
The link above does not even say the different services found in it. I have to look up the file name and then open it to find out the service name. Although it looks simple after doing all this it would be nice if they were listed on the documentation link it self. I still don't know what commands I need to pull out other stuff.
Then after some mindless clicking around I found that we can find or know about the api functions by actually clicking on the in the console.
https://console.developers.google.com/project/apps~<YOURAPPID>/apiui/api/drive -- cant format it sorry
Then I cobbled up some code and ended up with help of others in stack
try{
$file = $service->files->get(FILEID);
print "Title: " . $file->getTitle();
print "Description: " . $file->getDescription();
print "MIME type: " . $file->getMimeType();
}
catch (Exception $e) {
print "An error occurred: " . $e->getMessage();
}
FILEID is the long has value Google gives to each file. I figured I can test it using the online DriveAPI that allows to run querys and see what I get. I initially got error that the file was not found. It seems that I have to enable Oauth 2.0 for it to work.
As of now I got into the system and know what type of file I can see. I hope this helps any one who is trying it out for the first time. I will try to update once I can read info out of the file.