Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu kılavuzda, bir mesaja verilen tepkileri (ör. 👍, 🚲 ve 🌞) listelemek için Google Chat API'nin Reaction kaynağındaki list() yönteminin nasıl kullanılacağı açıklanmaktadır.
Reaction kaynağı, kullanıcıların bir mesaja tepki vermek için kullanabileceği emojileri (ör. 👍, 🚲 ve 🌞) temsil eder.
Masaüstü uygulaması için
OAuth istemci kimliği kimlik bilgileri oluşturun. Bu kılavuzda yer alan örneği çalıştırmak için kimlik bilgilerini yerel dizininize credentials.json adlı bir JSON dosyası olarak kaydedin.
Rehberlik için bu hızlı başlangıç kılavuzundaki ortamınızı kurma adımlarını tamamlayın.
import{createClientWithUserCredentials}from'./authentication-utils.js';constUSER_AUTH_OAUTH_SCOPES=['https://www.googleapis.com/auth/chat.messages.reactions.readonly'];// This sample shows how to list reactions to a message with user credentialasyncfunctionmain(){// Create a clientconstchatClient=awaitcreateClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);// Initialize request argument(s)constrequest={// Replace SPACE_NAME and MESSAGE_NAME here.parent:'spaces/SPACE_NAME/messages/MESSAGE_NAME'};// Make the requestconstpageResult=chatClient.listReactionsAsync(request);// Handle the response. Iterating over pageResult will yield results and// resolve additional pages automatically.forawait(constresponseofpageResult){console.log(response);}}main().catch(console.error);
Bu örneği çalıştırmak için aşağıdakileri değiştirin:
SPACE_NAME: Alanın name kimliği.
Kimliği, ListSpaces() yöntemini çağırarak veya alanın URL'sinden alabilirsiniz.
MESSAGE_NAME: İletinin name kimliği.
Kimliği, Chat API ile mesaj oluşturduktan sonra döndürülen yanıt gövdesinden veya mesaj oluşturulurken mesaja atanan özel addan elde edebilirsiniz.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-04-25 UTC."],[[["This guide explains how to use the `list()` method to retrieve reactions (e.g., 👍, 🚲, 🌞) for messages in Google Chat using the Google Chat API."],["Before you begin, ensure you have a Google Workspace account, set up a Google Cloud project, enable the Google Chat API, and install the Node.js Cloud Client Library."],["To list reactions, call the `ListReactions()` method, providing the message's resource name and specifying the necessary authorization scope."],["You'll need the space ID and message ID to construct the resource name for the `ListReactions()` method call."],["The Chat API returns a paginated list of reactions for the specified message."]]],["This guide details listing reactions (emojis like 👍, 🚲, 🌞) on Google Chat messages using the Chat API's `ListReactions()` method. Key actions include setting up a Google Cloud project, enabling the Chat API, and obtaining OAuth credentials. To list reactions, specify the appropriate authorization scope (`chat.messages.reactions.readonly`, etc.) and call `ListReactions()`, passing the message's resource name as the `parent`. The API returns a paginated list of reactions.\n"]]