이 가이드에서는 Google Chat API의 Attachment 리소스에서 get() 메서드를 사용하여 메시지 첨부파일에 관한 메타데이터를 가져오는 방법을 설명합니다. 응답은 Attachment 리소스의 인스턴스입니다.
사용자가 앱에 메시지를 보내면 Google Chat에서 MESSAGE 상호작용 이벤트를 전달합니다.
앱에서 수신하는 상호작용 이벤트에는 첨부파일을 포함하여 상호작용 이벤트를 나타내는 JSON 페이로드인 요청 본문이 포함됩니다. 첨부파일의 데이터는 첨부파일이 업로드된 콘텐츠 (로컬 파일)인지 아니면 Drive에 저장된 파일인지에 따라 다릅니다. Media 리소스는 이미지, 동영상, 문서와 같이 Google Chat에 업로드된 파일을 나타냅니다.
Attachment 리소스는 메시지에 첨부된 미디어(파일)의 인스턴스를 나타냅니다. Attachment 리소스에는 저장 위치와 같은 첨부파일에 관한 메타데이터가 포함됩니다.
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-02-14(UTC)"],[[["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."]]],["The core actions involve retrieving metadata about a message attachment in Google Chat using the `get()` method. This requires the `chat.bot` authorization scope and calling `GetAttachment()`, providing the attachment's `name`. Before using the `get()` method, you must set up a Google Cloud project, configure the OAuth consent screen, and set up the Google Chat API. The `Attachment` resource represents the file, with metadata detailing its storage. The request triggers a response with `Attachment` details.\n"]]