import{createClientWithAppCredentials}from'./authentication-utils.js';// This sample shows how to get attachment metadata with app credentialasyncfunctionmain(){// Create a clientconstchatClient=createClientWithAppCredentials();// Initialize request argument(s)constrequest={// Replace SPACE_NAME, MESSAGE_NAME, and ATTACHMENT_NAME herename:'spaces/SPACE_NAME/messages/MESSAGE_NAME/attachments/ATTACHMENT_NAME'};// Make the requestconstresponse=awaitchatClient.getAttachment(request);// Handle the responseconsole.log(response);}main().catch(console.error);
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-11-10 (世界標準時間)。"],[[["This guide explains how to retrieve metadata about a message attachment in Google Chat using the `get()` method."],["The `Attachment` resource represents an instance of a file attached to a message and includes metadata like its location."],["To get attachment metadata, you need to use the `chat.bot` authorization scope and call the `GetAttachment()` method with the attachment's name."],["Prerequisites include a Google Workspace account, a Google Cloud project, and Node.js setup with necessary libraries and credentials."]]],[]]