Search code examples
vbacontactsgoogle-people-api

Google, people api, how can I create a contact in a group


With people.createContact I can easily create a contact in myContacts.

But how do I create a contact in a special group ??


Solution

  • You can create the contact with the method - people.createContact, as you are probably already doing.

    All you have to change is to specify a membership:

    "memberships": [
        {
          "contactGroupMembership": {
            "contactGroupResourceName": "contactGroups/PASTE_HERE_THE_NAME_OF_THE_GROUP"
          }
        }
      ]
    

    Have a look at this sample.