조직의 맞춤 이모티콘 나열

이 가이드에서는 Google Chat API의 CustomEmoji 리소스에서 list 메서드를 사용하여 Google Workspace 조직에서 인증된 사용자에게 표시되는 맞춤 이모티콘을 나열하는 방법을 설명합니다.

맞춤 이모티콘은 Google Workspace 계정에서만 사용할 수 있으며 관리자가 조직의 맞춤 이모티콘을 사용 설정해야 합니다. 자세한 내용은 Google Chat의 맞춤 이모티콘 알아보기 및 맞춤 이모티콘 권한 관리를 참고하세요.

기본 요건

Node.js

조직의 맞춤 이모티콘 나열

사용자 인증으로 조직의 맞춤 이모티콘을 나열하려면 요청에 다음을 전달합니다.

  • chat.customemojis 승인 범위를 지정합니다.
  • ListCustomEmojis 메서드를 호출합니다.

다음 예에서는 조직의 맞춤 이모티콘을 나열합니다.

Node.js

chat/client-libraries/cloud/list-custom-emojis-user-cred.js
import {createClientWithUserCredentials} from './authentication-utils.js';

const USER_AUTH_OAUTH_SCOPES = [
  'https://www.googleapis.com/auth/chat.customemojis',
];

// This sample shows how to get custom emoji with user credential
async function main() {
  // Create a client
  const chatClient = await createClientWithUserCredentials(
    USER_AUTH_OAUTH_SCOPES,
  );

  // Initialize request argument(s)
  const request = {
    // Optional. Replace FILTER here
    filter: 'FILTER',
  };

  // Make the request
  const pageResult = await chatClient.listCustomEmojisAsync(request);

  // Handle the response. Iterating over pageResult will yield results and
  // resolve additional pages automatically.
  for await (const response of pageResult) {
    console.log(response);
  }
}

await main();

이 샘플을 실행하려면 다음을 바꿉니다.

  • FILTER: 선택사항으로, 목록 요청에 적용할 필터입니다.