Reference documentation and code samples for the Google Apps Chat V1 Client class Annotation.
Output only. Annotations can be associated with the plain-text body of the
message or with chips that link to Google Workspace resources like Google
Docs or Sheets withstart_indexandlengthof 0. To add basic formatting
to a text message, seeFormat text
messages.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class Annotation (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Chat.V1.Annotation)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Chat.V1.Annotation)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Chat.V1.Annotation)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Chat.V1.Annotation)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Chat.V1.Annotation)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Chat.V1.Annotation)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Chat.V1.Annotation)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Chat.V1.Annotation)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Chat.V1.Annotation)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Chat.V1.Annotation)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Chat.V1.Annotation)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Chat.V1.Annotation) \nReference documentation and code samples for the Google Apps Chat V1 Client class Annotation.\n\nOutput only. Annotations can be associated with the plain-text body of the\nmessage or with chips that link to Google Workspace resources like Google\nDocs or Sheets with `start_index` and `length` of 0. To add basic formatting\nto a text message, see [Format text\nmessages](https://developers.google.com/workspace/chat/format-messages).\n\nExample plain-text message body: \n\n Hello @FooBot how are you!\"\n\nThe corresponding annotations metadata: \n\n \"annotations\":[{\n \"type\":\"USER_MENTION\",\n \"startIndex\":6,\n \"length\":7,\n \"userMention\": {\n \"user\": {\n \"name\":\"users/{user}\",\n \"displayName\":\"FooBot\",\n \"avatarUrl\":\"https://goo.gl/aeDtrS\",\n \"type\":\"BOT\"\n },\n \"type\":\"MENTION\"\n }\n }]\n\nGenerated from protobuf message `google.chat.v1.Annotation`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Chat \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getType\n\nThe type of this annotation.\n\n### setType\n\nThe type of this annotation.\n\n### getStartIndex\n\nStart index (0-based, inclusive) in the plain-text message body this\nannotation corresponds to.\n\n### hasStartIndex\n\n### clearStartIndex\n\n### setStartIndex\n\nStart index (0-based, inclusive) in the plain-text message body this\nannotation corresponds to.\n\n### getLength\n\nLength of the substring in the plain-text message body this annotation\ncorresponds to. If not present, indicates a length of 0.\n\n### setLength\n\nLength of the substring in the plain-text message body this annotation\ncorresponds to. If not present, indicates a length of 0.\n\n### getUserMention\n\nThe metadata of user mention.\n\n### hasUserMention\n\n### setUserMention\n\nThe metadata of user mention.\n\n### getSlashCommand\n\nThe metadata for a slash command.\n\n### hasSlashCommand\n\n### setSlashCommand\n\nThe metadata for a slash command.\n\n### getRichLinkMetadata\n\nThe metadata for a rich link.\n\n### hasRichLinkMetadata\n\n### setRichLinkMetadata\n\nThe metadata for a rich link.\n\n### getCustomEmojiMetadata\n\nThe metadata for a custom emoji.\n\n### hasCustomEmojiMetadata\n\n### setCustomEmojiMetadata\n\nThe metadata for a custom emoji.\n\n### getMetadata"]]