빠른 시작에서는 Google Workspace API를 호출하는 앱을 설정하고 실행하는 방법을 설명합니다. 이 빠른 시작에서는 테스트 환경에 적합한 간소화된 인증 방식을 사용합니다. 프로덕션 환경의 경우 앱에 적합한 액세스 사용자 인증 정보 선택 전에 인증 및 승인에 대해 알아보는 것이 좋습니다.
Apps Script에서 Google Workspace 빠른 시작은 고급 Google 서비스를 사용하여 Google Workspace API를 호출하고 인증 및 승인 흐름의 일부 세부정보를 처리합니다.
/** * @typedef {Object} EmailAddress * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {string} value * Note: This is a partial definition. *//** * @typedef {Object} Name * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {string} displayName * Note: This is a partial definition. *//** * @typedef {Object} Person * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {Name[]} names * @property {EmailAddress[]} [emailAddresses] * Note: This is a partial definition. *//** * @typedef {Object} Connection * @see https://developers.google.com/people/api/rest/v1/people.connections/list * @property {Person[]} connections * Note: This is a partial definition. *//** * Print the display name if available for 10 connections. */functionlistConnectionNames(){// Use the People API to list the connections of the logged in user.// See: https://developers.google.com/people/api/rest/v1/people.connections/listif(!People||!People.People||!People.People.Connections){thrownewError("People service not enabled.");}constconnections=People.People.Connections.list("people/me",{pageSize:10,personFields:"names,emailAddresses",});if(!connections.connections){console.log("No connections found.");return;}for(constpersonofconnections.connections){if(person.names&&
person.names.length > 0&&
person.names[0].displayName){console.log(person.names[0].displayName);}else{console.log("No display name found for connection.");}}}
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-11-28(UTC)"],[],["This document guides users to create and run a Google Apps Script that interacts with the People API. It involves configuring a new script on `script.google.com`, replacing the script editor's content with provided code, saving, and renaming the project. Users must enable the People API as a service within the script and authorize access during the initial run. The script then lists the display names of 10 connections. Production environments need appropriate authentication credentials.\n"]]