Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Getting user info Google-PHP-Client issue?

$
0
0

First, i just want to say what information i am needing to get from the user.

  • Full Name (First/Last)
  • Email Address (Main Account, not @google-plus.com)
  • Location (Country, State, city, address)
  • Youtube Username

To get all of this information, i went ahead and download/installed the PHP-Client Library located here.

Since this is my first time using the API, i looked around and found the following scopes:

$client->setScopes(array('https://www.googleapis.com/auth/youtube.readonly','https://www.googleapis.com/auth/userinfo.profile','https://www.googleapis.com/auth/userinfo.email'));

For some reason, when i run this: $myData = $GoogleData->userinfo->get('me'); i get this:

Undefined property: Google_Service_Plus::$userinfo in path/test.php on line 61

Not too sure what i am doing wrong, or even if i should be using the Google Plus Api to get this information.

I need the Main Account email (Contains all youtube channels) and the users address, etc. That they signed up in their Google Account. How do i get this information and what am i doing wrong in my above example?

I have actually created a chat room dedicated to all things Google API (Go here)

This also brings me to another point. Why is the documentation sooo outdated and not taken care of. Most of the examples that i see are from two years ago, but i am using something that has been updated a couple months ago.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>