List custom emojis in an organization

This guide explains how to use the list method on the CustomEmoji resource of the Google Chat API to list custom emoji visible to the authenticated user in a Google Workspace organization.

Custom emojis are only available for Google Workspace accounts, and your administrator must turn custom emoji on for your organization. For more information, see Learn about custom emoji in Google Chat and Manage custom emoji permissions.

Prerequisites

Node.js

List custom emoji in an organization

To list custom emoji in an organization with user authentication, pass the following in your request:

  • Specify the chat.customemojis authorization scope.
  • Call the ListCustomEmojis method.

The following example list custom emoji in an organization.

Node.js

chat/client-libraries/cloud/list-custom-emojis-user-cred.js
import{createClientWithUserCredentials}from'./authentication-utils.js';
constUSER_AUTH_OAUTH_SCOPES=[
'https://www.googleapis.com/auth/chat.customemojis',
];
// This sample shows how to get custom emoji with user credential
asyncfunctionmain(){
// Create a client
constchatClient=awaitcreateClientWithUserCredentials(
USER_AUTH_OAUTH_SCOPES,
);
// Initialize request argument(s)
constrequest={
// Optional. Replace FILTER here
filter:'FILTER',
};
// Make the request
constpageResult=awaitchatClient.listCustomEmojisAsync(request);
// Handle the response. Iterating over pageResult will yield results and
// resolve additional pages automatically.
forawait(constresponseofpageResult){
console.log(response);
}
}
awaitmain();

To run this sample, replace the following:

  • FILTER: Optional, the filter to apply to the list request.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月13日 UTC.