简体   繁体   中英

How can I get a user's Google+ ID from its email address?

I have a user's Gmail e-mail address and I need to get his or her Google+ ID to get additional information about him or her, like name, and so on. Is there a way to do this using the Google APIs?

There is no publicly available API to identify the Google+ profile associated with an email address. There is an existing feature request you should star if you are interested in such an API.

Tricky, but works. If you have a G Suite Domain (aka Google Apps) you can create a new group with emails addreses and call Members method.Groups API response contains user ID.

https://developers.google.com/admin-sdk/directory/v1/reference/members/list

Response looks like :

{
  "kind": "admin#directory#members",
  "etag": etag,
  "members": [
    **members Resource**
  ],
  "nextPageToken": string
}

Where members rersource looks like :

{
  "kind": "admin#directory#member",
  "etag": etag,
  "id": string,
  "email": string,
  "role": string,
  "type": string
} 

id is the Google+ Profile id, later you can use Google+ API with people method.

Google plus login to your gmail account then Put that gmail-email address to search option. If that user is on Google plus then you will able to see his/her profile.

If you want to create new one with specific format for you then you can get it after making few friend on it. Google will notify you when you will pass the position. you can create your own customized profile in it.

Not exactly from the email address itself, but if you have a JWT token you can get the information from that. The id is one of the claims in the token. So if you have a server that uses Google issued JWT tokens, decode the token. Here's a website to view the token information: https://jwt.ms/

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