Search code examples
pythongoogle-apigoogle-plusgoogle-api-python-client

Google plus: get 'me'


I've been trying to find any clear documentation that explains the flow of getting profile data (including email) of an authenticated and authorized user (starting from the point where I have his auth_token). I can't find it anywhere on google's dev site.

Is there a simple scenario of urls that I need to call with the auth token to get the profile info (including email)?

I don't care for the authentication/authorization portion -- I'm past that already.

I'm using python, but it doesn't really matter since I'm not looking for any particular framework.


Solution

  • You want to make a people.get request with an access_token that grants the email scope.

    You can try a live example.

    GET /plus/v1/people/me
    Host: https://www.googleapis.com
    Authorization:  Bearer ya29.cABDhy4M21HMayoAAABH5qlNLgr...
    
    HTTP/1.1 200 OK
    Content-Type: application/json; charset=UTF-8
    {
        "kind": "plus#person",
        "id": "114233674199568482864",
        "displayName": "Abraham Williams",
        "emails": [
            {
                "value": "[email protected]",
                "type": "account"
            }
        ],
        ...
    }