บริการการตั้งค่ากลุ่มของ Admin SDK ช่วยให้คุณใช้ Groups Settings API ของ Admin SDK ใน Apps Script ได้ API นี้
ช่วยให้ผู้ดูแลระบบโดเมน Google Workspace
(รวมถึงตัวแทนจำหน่าย) สามารถจัดการการตั้งค่ากลุ่มสำหรับกลุ่มใน
บัญชี Google Workspace ของตนเองได้
ข้อมูลอ้างอิง
ดูข้อมูลโดยละเอียดเกี่ยวกับบริการนี้ได้ในเอกสารอ้างอิงสำหรับ Admin SDK Groups Settings API เช่นเดียวกับบริการขั้นสูงทั้งหมดใน Apps Script บริการการตั้งค่ากลุ่มของ Admin SDK จะใช้ออบเจ็กต์ เมธอด และพารามิเตอร์เดียวกันกับ API สาธารณะ ดูข้อมูลเพิ่มเติมได้ที่วิธีกำหนดลายเซ็นของเมธอด
/** * Gets a group's settings and logs them to the console. */functiongetGroupSettings(){// TODO (developer) - Replace groupId value with yoursconstgroupId='exampleGroup@example.com';try{constgroup=AdminGroupsSettings.Groups.get(groupId);console.log(JSON.stringify(group,null,2));}catch(err){// TODO (developer)- Handle exception from the APIconsole.log('Failed with error %s',err.message);}}
/** * Updates group's settings. Here, the description is modified, but various * other settings can be changed in the same way. * @see https://developers.google.com/admin-sdk/groups-settings/v1/reference/groups/patch */functionupdateGroupSettings(){constgroupId='exampleGroup@example.com';try{constgroup=AdminGroupsSettings.newGroups();group.description='Newly changed group description';AdminGroupsSettings.Groups.patch(group,groupId);}catch(err){// TODO (developer)- Handle exception from the APIconsole.log('Failed with error %s',err.message);}}