Method: spaces.findDirectMessage
傳回與指定使用者互傳的現有即時訊息。如果找不到即時訊息聊天室,則傳回 404 NOT_FOUND
錯誤。如需範例,請參閱「尋找即時訊息」。
使用應用程式驗證時,會傳回指定使用者和發出呼叫 Chat 應用程式之間的即時訊息空間。
使用使用者驗證時,會傳回指定使用者和已驗證使用者之間的即時訊息空間。
// 支援下列類型的驗證:
HTTP 要求
GET https://chat.googleapis.com/v1/spaces:findDirectMessage
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
name |
string
必要欄位。要尋找即時訊息的使用者資源名稱。 格式:users/{user} ,其中 {user} 是 People API 中 person 的 id ,或是 Directory API 中 user 的 id 。舉例來說,如果 People API 個人資料 ID 是 123456789 ,您可以使用 users/123456789 做為 name ,找出與該使用者進行即時訊息對話的資料。以使用者身分驗證後,您可以使用電子郵件做為 {user} 的別名。例如 users/example@gmail.com ,其中 example@gmail.com 是 Google Chat 使用者的電子郵件地址。
|
回應主體
如果成功,回應主體會包含 Space
的執行例項。
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/chat.bot
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-12 (世界標準時間)。
[null,null,["上次更新時間:2024-11-12 (世界標準時間)。"],[[["Retrieves the existing direct message with a specified user or Chat app, returning a 404 error if none is found."],["Supports both app authentication and user authentication for finding direct messages."],["Requires providing the resource name of the user in the `name` query parameter using specific formats."],["Uses a `GET` HTTP request to the `https://chat.googleapis.com/v1/spaces:findDirectMessage` endpoint with gRPC Transcoding syntax."],["Needs authorization with specific OAuth scopes like `chat.spaces`, `chat.spaces.readonly`, or `chat.bot`."]]],[]]