简体   繁体   中英

Fetch Google+ emails from Google People API

I'm doing like this.

    ListConnectionsResponse r = peopleService.people().connections()
            .list("people/me")
            .setPageSize(500)
            // specify fields to be returned
            .setRequestMaskIncludeField("person.names,person.emailAddresses")
            .execute();

It returns a list of my connections with emails I have added myself. But not the information gathered from Google+ profiles. Is this possible to fetch also? I tried fetching the individual resourceName, but no email there.

    Person p = peopleService.people().get("people/XXxxx").execute();

The Google People API actually does fetch the emails from Google+ profiles, but only the public e-mails. So if the e-mail shows up when you view their profile when not signed in, then it should show up in the response.

However, e-mails that are not public but are shared with your account (e-mails you can only see if you are signed in) are NOT visible through the Google People API for privacy reasons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM