Search code examples
pythongoogle-workspacegoogle-people-api

Google Workspace: Update birthday in google profile


I'm new to google API and I'm a little confused here. I want to update persons birthday in google profile using python.

I can get birthday with the People API method people.listDirectory. But there is no method like set or update there. Closest thing I found is updateContact, and though it has field birthday, I'm not sure if that's the right thing. Is it, like, a birthday, that user can set for their contacts? I haven't seen such an option in my contacts. Also, I can't use alias people/me there, and when I use the resourceName, that I got from listDirectoryPeople, I get an

Resource name {resourceName} is not a valid contact person resource.

I can update user data with Directory API method users.update. But there is no birthday field in this user.

So, is it even possible?


Solution

  • So according to Google's documentation for the People's API:

    The People API lets you:

    Read and manage the authenticated user's Contacts
    Read and copy the authenticated user's Other contacts
    Read profile information for authenticated users and their contacts
    Read domain profiles and contacts

    If I understand your question properly, it seems like you want to change not the birthday of one of the authenticated user's contacts, but the birthday of the authenticated user themself. Unfortunately it does not seem like this capability is available in the Google People API. I looked around elsewhere in the Google documentation but was unable to find somewhere that allowed one to directly edit their profile birthday programmatically. It is possible I missed something, but this honestly does not surprise me. It does not seem like programmatic updating of one's birthday would be a good feature to have, as one's birthday should be set upon account creation and only edited if a mistake was made, which can easily be done through the user interface.