Admin SDK 그룹스 설정 서비스

Admin SDK 그룹스 설정 서비스를 사용하면 Admin SDK의 Apps Script의 Groups Settings API 이 API 도메인 관리자를 통해 Google Workspace (리셀러 포함)의 그룹 설정을 관리할 수 있는 권한 Google Workspace 계정을 사용할 수 있습니다.

참조

이 서비스에 대한 자세한 내용은 참조 문서에서 Admin SDK 그룹스 설정 API Apps Script의 모든 고급 서비스와 마찬가지로 Admin SDK 그룹스 설정 서비스는 동일한 객체, 메서드, 매개변수를 사용 공개 API로 설정합니다. 자세한 내용은 메서드 서명 결정 방법을 참고하세요.

문제를 신고하고 기타 지원을 받으려면 다음을 참조하세요. Admin SDK 그룹 설정 지원 가이드

샘플 코드

아래의 샘플 코드는 버전 1을 사용합니다. API에 대해 알아봤습니다

그룹 설정 가져오기

이 샘플은 그룹 설정을 가져와 콘솔에 기록합니다.

advanced/adminSDK.gs
/**
 * Gets a group's settings and logs them to the console.
 */
function getGroupSettings() {
  // TODO (developer) - Replace groupId value with yours
  const groupId = 'exampleGroup@example.com';
  try {
    const group = AdminGroupsSettings.Groups.get(groupId);
    console.log(JSON.stringify(group, null, 2));
  } catch (err) {
    // TODO (developer)- Handle exception from the API
    console.log('Failed with error %s', err.message);
  }
}

그룹 설정 업데이트

이 샘플은 그룹 설정을 변경하는 방법을 보여줍니다. 여기서는 같은 방식으로 다른 다양한 설정도 변경할 수 있습니다.

advanced/adminSDK.gs
/**
 * 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
 */
function updateGroupSettings() {
  const groupId = 'exampleGroup@example.com';
  try {
    const group = AdminGroupsSettings.newGroups();
    group.description = 'Newly changed group description';
    AdminGroupsSettings.Groups.patch(group, groupId);
  } catch (err) {
    // TODO (developer)- Handle exception from the API
    console.log('Failed with error %s', err.message);
  }
}