I need to create a new group "Carpenters" (if the group doesn't exist) and add the created contact to "Carpenters" group
I have tried with
function doGet(e) {
var id = People.People.createContact(
{
"names": [
{
"displayNameLastFirst": "Smith Jefferson Jones",
"familyName": "Jones",
}
],
/* "phoneNumbers": [
{
'value': "+12345679962"
}
],
"emailAddresses": [
{
'value': ' '
}
]*/
}
).metadata.sources[0].id;
return ContentService.createTextOutput("Success");
}
You could do the following:
resourceNameof the created contact (to be used on step 4).nameisCarpenters(using find()).contactGroupcalledCarpentersif it doesn't exist, using contactGroups.create.Code sample:
Reference: