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:
resourceName
of the created contact (to be used on step 4).name
isCarpenters
(using find()).contactGroup
calledCarpenters
if it doesn't exist, using contactGroups.create.Code sample:
Reference: