g suite directory contacts not deleted - google-admin-sdk

I have used the G Suite shared contacts directory (https://developers.google.com/admin-sdk/domain-shared-contacts/) to delete a bunch of contacts. All contacts were deleted from an API point of view (the API no longer returns these contacts)
However a few of these "deleted" contacts remain visible in my contacts (contacts.google.com). When I click on one of these it shows 'The contact was not found'
Anyone had this problem and if so is there any way these 'zombie' contacts can be deleted from Google contacts?
contact not found

Related

Is it possible to delete Google Other Contacts via Apps Script?

Scenario
I'm a Google Workspace for Education admin. Every year we rename students' group names, but not their email addresses (ie '1st class' chimps#mydomain.edu becomes '2nd class' chimps#mydomain.edu)
when teachers search for groups (in Gmail, Classroom, etc.), autocompletion shows both the old and the new name: this is confusing, although groups and members are ok
this happens because on every first interaction with the group, user's Contacts app automatically save it in Other contacts; at new year's change, a new Other contact is added (not updating the previous one)
Long solution
Every teacher open Contacts > Other contacts and manually deletes the 'old groups', every new year
What I would
on new year beginning, a script that searches for Other contacts and deletes every students group if found (both a script that perform this on every user with domain-wide authority delegation to service account, or a web app that every teachers runs as himself would be ok); so no more old autocompletion, and new ones recreated at next interaction
I'm able to write down the script by myself, but I can't solve the followings
The problem
People API methods don't seem to support this in any way
People.People.deleteContacts only works on Contacts, but not on Other Contacts
People.OtherContacts methods seem to be readonly
tried to override this using People.OtherContacts.copyOtherContactToMyContactsGroup, and then deleting the contact - not working, the method creates a copy of the Other Contact, it seems not to be moving it from Other Contacts to Contacts
but if I try this last thing from Contacts web app, I can add the Other Contact to Contacts, and this operation moves (not copies) the contact!
so:
am I missing anything that could do what I need via Apps script?
is there a way to replicate this last behavior (moving from Other contacts to Contacts, instead of creating a copy) in Apps script?
thank you in advance
As mentioned in the documentation, you are only able to Read, Copy, and Search "Other contacts".
You can create a Feature Request on Google's Issue tracker to ask for the contact to be editable.

Access to other contacts groups information

From Google Contacts web interface you can edit a contact and include her in several groups/tags. Then if you decide to "Hide from contacts", the contact will not be in My contacts anymore, but she still exists in Other contacts, and also you can open her and see the groups.
However, People API don't let to know the groups of Other contacts, since you can only retrieve names , emailsAddresses and phoneNumbers.
Is there any workaround for this?
Ok, I figured out that Other contacts have the resourceName in the form otherContacts/<contact-id>, but if you change it to people/<contact-id> (keeping the same contact-id) you can retrieve all the other contact fields with People.People.get()

Missing photos in Google Admin Directory Users response

I'm using the Google Admin Directory Users endpoint to retrieve all the users in our company's domain. The request is working as expected and I'm receiving the full list of users.
But a large number of users are missing photos. The thumbnailPhotoUrl property is present on each user entry, but following the URL leads to
https://ssl.gstatic.com/s2/profiles/images/silhouette200.png
which is the default avatar, for a large number of our users.
However:
If I go into Inbox and send one of the users showing the default avatar an email, their profile pic appears when sending the email
And when the user logs in to our app using their company email (using
Firebase Auth), their user response contains a public URL for their avatar
And if I log in to G Suite Admin and view our users, the majority of them have avatars. Only a small handful of users show the silhouette avatar.
Also, the docs state:
Note: In this version of the API, a photo is the user's latest Gmail Chat profile photo. This is different from the Google+ profile photo.
From the accounts we've viewed, all users have Gmail Chat/Hangout profile photos.
So it seems the users have photos associated with their account. Why are the photo URLs in the Google Admin Directory showing the default avatar? And not the user's uploaded photo?
I ran into this today and found your question while trying to solve the problem. I think I have the answer!
The thumbnailPhotoUrl property in each of the user profiles that leads to silhouette200.png starts with https://www.google.com/s2/photos/private/ followed by a long id string.
On the other hand, any user profile that returns a valid photo (instead of redirecting to the default/anonymous photo) starts with https://www.google.com/s2/photos/public/ ... like my Google Apps/G Suite profile photo.
I discovered fairly quickly that if I am logged into my G Suite account in the browser where I try to view those thumbnail photos, they resolve as expected with actual photos instead of silhouette200.png.
So: to display G Suite user photos in a custom app, the app user needs to be logged in with a G Suite account that is authorized to read other G Suite domain users' private thumbnail photos
or
your app will need to proxy the photo request in order to return the actual thumbnail.
Of course, please do consider user privacy expectations and
regulations; the fact that the profile photo is private usually
indicates that the user did not set their own profile photo but had it
set by some external application or sync process. (As far as I can tell, when a user
sets their own profile photo using My Account or About Me,
it is always made public.)
Adding some documentation reference to help define the ultimate purpose.
Google API part is here.
Parameter viewType() defines what part of the user profile is returned which in turn depends on GSuite Directory settings. This parameter also defines the level of
authorization when using the Google API.
When using a third party app as defined here, more elements come into play.
In the end, thumbnails appeared...

Difference between "link" and "website" fields for Likes

For the past few months I've been using the "link" field present in data returned for a Like in order to determine whether the Open Graph object being liked is part of my application. For all that time the link field contained the og:url value for the object being liked. Now the link field contains a URL for a Facebook page that is automatically created for the object being liked. I've found that sometimes the "website" field contains the og:url value for the object but sometimes the website field is not returned (even when explicitly requested).
Is anyone else experiencing this issue? Did I miss an announcement from Facebook about how they are completely changing the meaning of these fields? Am I taking crazy pills? Is this just a symptom of the many current bugs surrounding like/send functionality right now? I wanted to throw this out to the community before filing a bug report.
Open Graph Protocol
Page Administration
To administer your page, you need to associate it with either your Facebook account or your Facebook Platform application. It is valid to associate your page with both user accounts and a Facebook Platform Application.
To associate the page with your Facebook account, add the additional property fb:admins to your page with a comma-separated list of the user IDs or usernames of the Facebook accounts who own the page, e.g.:
<meta property="fb:admins" content="USER_ID1,USER_ID2"/>
Each listed user must click Like on the URL to be approved as an admin. This is to prevent users being made admins without their consent.
So I think using the site url depends on the admin users liked the page or not.

Can't read achievements for certain users

I'm experiencing some inconsistent behaviour when trying to read achievements from my app. I have 3 tests accounts, 2 of which I can read achievements. However the 3rd account always returns an empty array. All 3 accounts have the publish_action permission and I've tried using both the user and app access_token. Here's the query:
https://graph.facebook.com/{uid}/achievements?access_token={app_access_token}
or
https://graph.facebook.com/{uid}/achievements?access_token={user_access_token}
Now I know the 3rd account has achievements as I get an error when I try to give it an achievement it already has and the game ticker correctly shows the achievements it has earned.
Make sure the third user has granted "user_activities" extended permissions so that the activities can be read, not just published. You can verify this by calling /me/permissions.
Have you checked the facebook layout regarding achievements in your app? since in my FB account I can roll over my own achievements and I get a full list of the achievements configured with each game and in other acocunt that info is not available. The other distinctive feature is I see my thumbnail picture over the main facebook bar (the blue one next to log in)