REST Resource: customEmojis
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:CustomEmoji
JSON 表示法 |
{
"name": string,
"uid": string,
"emojiName": string,
"temporaryImageUri": string,
"payload": {
object (CustomEmojiPayload )
}
} |
欄位 |
name |
string
ID。伺服器指派的自訂表情符號資源名稱。 格式:customEmojis/{customEmoji}
|
uid |
string
僅供輸出。自訂表情符號資源的專屬鍵。
|
emojiName |
string
(非必要) 不可變動。使用者提供的自訂表情符號名稱,在機構內不重複。 建立自訂表情符號時必須提供,否則僅供輸出。 表情符號名稱開頭和結尾必須為冒號,且只能使用小寫英數字元、連字號和底線。連字號和底線可用於分隔字詞,但不能連續使用。 範例::valid-emoji-name:
|
temporaryImageUri |
string
僅供輸出。自訂表情符號的臨時圖片網址,有效時間至少 10 分鐘。請注意,建立自訂表情符號時,回應中不會填入這個值。
|
payload |
object (CustomEmojiPayload )
(非必要) 僅限輸入。酬載資料。建立自訂表情符號時,此為必填欄位。
|
CustomEmojiPayload
JSON 表示法 |
{
"fileContent": string,
"filename": string
} |
欄位 |
fileContent |
string (bytes format)
必要欄位。僅限輸入。自訂表情符號使用的圖片。 酬載大小必須小於 256 KB,且圖片尺寸必須為正方形,且介於 64 到 500 像素之間。限制條件可能會有所變動。
|
filename |
string
必要欄位。僅限輸入。圖片檔案名稱。 支援的檔案副檔名:.png 、.jpg 、.gif 。
|
方法 |
|
建立自訂表情符號。 |
|
刪除自訂表情符號。 |
|
傳回自訂表情符號的詳細資料。 |
|
列出已驗證使用者可看見的自訂表情符號。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThis documentation outlines the \u003ccode\u003eCustomEmoji\u003c/code\u003e resource, representing a custom emoji within Google Chat, including its properties and JSON representation.\u003c/p\u003e\n"],["\u003cp\u003eIt describes the \u003ccode\u003eCustomEmojiPayload\u003c/code\u003e, detailing the data required for creating a custom emoji, specifically focusing on image content and filename.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the provided methods to create, delete, retrieve, or list custom emojis using the Google Chat API.\u003c/p\u003e\n"],["\u003cp\u003eThese functionalities are currently part of the Google Workspace Developer Preview Program, granting early access for testing and development purposes.\u003c/p\u003e\n"]]],["Custom emojis, part of the Google Workspace Developer Preview, are defined by a name, unique identifier (`uid`), and user-provided `emojiName` that must be enclosed in colons. A `temporaryImageUri` is provided. The `payload` contains the image's `fileContent` (under 256 KB) and `filename` (.png, .jpg, .gif). Key actions include: creating custom emojis, deleting them, retrieving details, and listing all visible custom emojis. All these actions are performed through the corresponding methods.\n"],null,["# REST Resource: customEmojis\n\n- [Resource: CustomEmoji](#CustomEmoji)\n - [JSON representation](#CustomEmoji.SCHEMA_REPRESENTATION)\n - [CustomEmojiPayload](#CustomEmoji.CustomEmojiPayload)\n - [JSON representation](#CustomEmoji.CustomEmojiPayload.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: CustomEmoji\n---------------------\n\nRepresents a [custom emoji](https://support.google.com/chat/answer/12800149).\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"uid\": string, \"emojiName\": string, \"temporaryImageUri\": string, \"payload\": { object (/workspace/chat/api/reference/rest/v1/customEmojis#CustomEmoji.CustomEmojiPayload) } } ``` |\n\n| Fields ||\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}` |\n| `uid` | `string` Output only. Unique key for the custom emoji resource. |\n| `emojiName` | `string` Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization. Required when the custom emoji is created, output only otherwise. Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively. Example: `:valid-emoji-name:` |\n| `temporaryImageUri` | `string` Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created. |\n| `payload` | `object (`[CustomEmojiPayload](/workspace/chat/api/reference/rest/v1/customEmojis#CustomEmoji.CustomEmojiPayload)`)` Optional. Input only. Payload data. Required when the custom emoji is created. |\n\n### CustomEmojiPayload\n\nPayload data for the custom emoji.\n\n| JSON representation |\n|-------------------------------------------------------|\n| ``` { \"fileContent\": string, \"filename\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `fileContent` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` Required. Input only. The image used for the custom emoji. The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change. |\n| `filename` | `string` Required. Input only. The image file name. Supported file extensions: `.png`, `.jpg`, `.gif`. |\n\n| Methods ------- ||\n|-------------------------------------------------------------------------|--------------------------------------------------------|\n| ### [create](/workspace/chat/api/reference/rest/v1/customEmojis/create) | Creates a custom emoji. |\n| ### [delete](/workspace/chat/api/reference/rest/v1/customEmojis/delete) | Deletes a custom emoji. |\n| ### [get](/workspace/chat/api/reference/rest/v1/customEmojis/get) | Returns details about a custom emoji. |\n| ### [list](/workspace/chat/api/reference/rest/v1/customEmojis/list) | Lists custom emojis visible to the authenticated user. |"]]