Google People API - Directory Contacts - Cannot get name field from API

Viewed 312

We are using People API to fetch details from Directory . The API is not returning the name for most of the people in the directory. 2 accounts in our GSuite account alone provide the name field, while the others don't. However, other details like emailAddresses and phoneNumbers are available for everyone.

We didn't find any finer grained control for individual fields when using the setting External Directory Sharing → Domain and public data

We tried to change the setting from default to External Directory Sharing → Public data and authenticated user basic profile fields. However, this results in API response showing PERMISSION_DENIED error.

For one of the users in directory, we created Google Currents account. When the account was created and active, the name field became available for this user. After the account was deleted/deactivated, the name field was no longer available.

People API being used:

GET https://people.googleapis.com/v1/people:searchDirectoryPeople?query=a&sources=DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT&sources=DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE&readMask=emailAddresses,names,phoneNumbers,photos

The docs we have referred to so far are as follows:

People API - Search Directory: https://developers.google.com/people/api/rest/v1/people/searchDirectoryPeople

Let third-party apps access Directory data: https://support.google.com/a/answer/6343701

A merged view of people information: https://developers.google.com/people/#a_merged_view_of_people_information

Edit:

cURL command:

curl --location --request GET 'https://people.googleapis.com/v1/people:searchDirectoryPeople?query=s&sources=DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT&sources=DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE&readMask=emailAddresses,names,phoneNumbers,photos' \
--header 'Authorization: Bearer <access-token>'
0 Answers
Related