Display Directory users thumbnail image

I managed to create an address book of every active employees in the company, by populating a Google Sheets from data fetched via the Workspace Admin/ people API from our organization Google Workspace account.

The only thing I do not manage is to display every staff memberโ€™s Google profile image (user.thumbnailPhotoUrl).
The image URLs I fetch are the โ€œprivateโ€ URLs, and thus do not show in the generated View - many users have it set. And so, to test I made sure mine is set to public view. I would like the profile images to display, as long as the user set its image privacy to visible for the organization

If I write my query with the viewType:'domain_public', I can see my image. The problem is that I also need to fetch a custom attribute, which requires projection: "full" โ€ฆ which requires a more restrictive viewType.

Right now I have it so:

const  list = AdminDirectory.Users.list({
      query:'isSuspended=false',
      domain:'becode.org',
      projection: "full",
      viewType:'admin_view',
      //viewType:'domain_public',
      maxResults: 500,
      orderBy:'givenName',
      sortOrder:'descending',
    }).users;

which returns this image URL for me:

https://www.google.com/s2/photos/private/AIbEiAIAAABECOX77ciqmPC7xAEiC3ZjYXJkX3Bob3RvKig2ZTRjMWQ1ZjI2MjI4MmM0NzRlZTEyZTkyYjc2MTlhOTFmZTliYjMxMAHZOEb3C9D1cwQwUnR8oCaq857t-g

It is visible to me but not to anyone else.

So: how should I set up my app, so that the users images are visible (provided the user has set the image privacy display restrictions at least to โ€œorganizationโ€?
The app will only be accessible for our employees, not anyone else outside the organization.

0 1 412
1 REPLY 1

Steve
Platinum 4
Platinum 4

To the best of my knowledge, AppSheet can only access images that are stored in your primary data source, or that are publicly available on the internet. Admittedly, I have no experience with Workspace or Teams, so I may just be unaware.

Top Labels in this Space