Get details about a custom emoji

This guide explains how to use the get method on the CustomEmoji resource of the Google Chat API to get details about a custom emoji.

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

Get details about a custom emoji

To get details about a custom emoji with user authentication, pass the following in your request:

  • Specify the chat.customemojis authorization scope.
  • Call the GetCustomEmoji method.
  • In the request body, set name to the resource name of the custom emoji to get.

The following example gets details of a custom emoji.

Node.js

chat/client-libraries/cloud/get-custom-emoji-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={
// TODO(developer): Replace EMOJI_NAME here
name:'customEmojis/EMOJI_NAME',
};
// Make the request
constresponse=awaitchatClient.getCustomEmoji(request);
// Handle the response
console.log(response);
}
awaitmain();

To run this sample, replace the following:

  • EMOJI_NAME: the unique name for your custom emoji, in the emoji_name field. You can obtain the ID by calling the ListCustomEmoji() method, or from the response body returned after creating a custom emoji asynchronously with the Chat API.

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.