Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google plus's access_token integration

I followed : http://developers.google.com/+/api/oauth and :
http://developers.google.com/+/api/latest/people/get#examples

After I acquired the access token I didn't understand how to get the user's ID? How do I use it to get the user's data?

like image 238
Ilya Morgenshtern Avatar asked Feb 23 '23 22:02

Ilya Morgenshtern


1 Answers

With the access token, you can make a people.get request with the userId me:

GET https://www.googleapis.com/plus/v1/people/me?access_token=1234567890
                                              ↑

The returned person resource has an Id property that contains the userId of the user:

{
    "kind": "plus#person",
    "id": "108189587050871927619",
    ...             ↑
}
like image 161
dtb Avatar answered Feb 25 '23 11:02

dtb