AI-generated Key Takeaways
-
Retrieves information about a list of specific people, including the authenticated user, by specifying resource names.
-
Requires the
personFieldsquery parameter to specify desired data fields and returns a 400 error if it's missing. -
Supports various authorization scopes for accessing private data, although public data requires no authorization.
-
Returns a JSON response containing an array of
PersonResponseobjects, each corresponding to a requested resource name. -
Uses the
GETHTTP method and thehttps://people.googleapis.com/v1/people:batchGetendpoint with gRPC Transcoding syntax.
Provides information about a list of specific people by specifying a list of requested resource names. Use people/me to indicate the authenticated user.
The request returns a 400 error if 'personFields' is not specified.
HTTP request
GET https://people.googleapis.com/v1/people:batchGet
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
resourceNames[] |
Required. The resource names of the people to provide information about. It's repeatable. The URL query parameter should be
There is a maximum of 200 resource names. |
requestMask |
DEPRECATED (Please use A mask to restrict results to a subset of person fields. |
personFields |
Required. A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are:
|
sources[] |
Optional. A mask of what source types to return. Defaults to |
Request body
The request body must be empty.
Response body
The response to a get request for a list of people by resource name.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"responses": [
{
object ( |
| Fields | |
|---|---|
responses[] |
The response for each requested resource name. |
Authorization scopes
No authorization required to access public data. For private data, one of the following OAuth scopes is required:
https://www.googleapis.com/auth/contactshttps://www.googleapis.com/auth/contacts.readonlyhttps://www.googleapis.com/auth/contacts.other.readonlyhttps://www.googleapis.com/auth/directory.readonlyhttps://www.googleapis.com/auth/profile.agerange.readhttps://www.googleapis.com/auth/profile.emails.readhttps://www.googleapis.com/auth/profile.language.readhttps://www.googleapis.com/auth/user.addresses.readhttps://www.googleapis.com/auth/user.birthday.readhttps://www.googleapis.com/auth/user.emails.readhttps://www.googleapis.com/auth/user.gender.readhttps://www.googleapis.com/auth/user.organization.readhttps://www.googleapis.com/auth/user.phonenumbers.readhttps://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/userinfo.profilehttps://www.googleapis.com/auth/profile.language.read
For more information, see the Authorization guide.