Google people.searchDirectoryPeople doesn't return peoples photos

Viewed 100

I'm trying to use people.searchDirectoryPeople API to get photos from people in my organization. According to the documentation, I should have the https://www.googleapis.com/auth/directory.readonly access token, which I have provided. But results are missing the photos array ( according to the documentation there should be a photos array for each one of the results). I've set the mask to photos. If I set it to emailAddresses,photos It will return the emailAddresses array but not the photos. I can't find what I'm missing here, is there any specific scope that I should add or some other parameter. enter image description here

P.S: I've added the https://www.googleapis.com/auth/userinfo.profile scope too, but no luck. Any idea where I should continue looking/investigating?

Thanks!

1 Answers

I've managed to find the root of the problem. When I added a new user to my account, I added their images from the Google Amin page, but that seems to be the issue. Those photos are not shown when using the People API. When I logged in to the newly created account and changed the profile photo from there, it started showing in the results from API. Maybe it's but if you go back to Google Admin and change it again, it will stop showing again.

Looks like it's a bug in the Google Admin page or it is intended behavior but not mentioned in the documentation. I've reported an issue: https://issuetracker.google.com/issues/228791251

Related