Method: media.upload

透過集合功能整理內容 你可以依據偏好儲存及分類內容。

上傳附件。要求使用者進行驗證

HTTP 要求

  • 媒體上傳要求的 URI:
    POST https://chat.googleapis.com/upload/v1/{parent=spaces/*}/attachments:upload
  • 中繼資料 URI (僅限中繼資料要求):
    POST https://chat.googleapis.com/v1/{parent=spaces/*}/attachments:upload

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
parent

string

必要欄位。上傳附件的 Chat 聊天室資源名稱。格式為「spaces/{space}」,

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "filename": string
}
欄位
filename

string

必要欄位。附件的檔案名稱,包括副檔名。

回應主體

如果成功,回應主體即會包含具有以下結構的資料:

JSON 表示法
{
  "attachmentDataRef": {
    object (AttachmentDataRef)
  }
}
欄位
attachmentDataRef

object (AttachmentDataRef)

上傳附件的參照。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/chat.messages.create
  • https://www.googleapis.com/auth/chat.messages

詳情請參閱授權指南