Trả về tin nhắn trực tiếp hiện có với người dùng đã chỉ định. Nếu không tìm thấy không gian tin nhắn trực tiếp, hãy trả về lỗi 404 NOT_FOUND. Để biết ví dụ, hãy xem phần Tìm tin nhắn trực tiếp.
Với quy trình xác thực ứng dụng, trả về không gian tin nhắn trực tiếp giữa người dùng được chỉ định và ứng dụng Chat đang gọi.
Với quy trình xác thực người dùng, trả về không gian tin nhắn trực tiếp giữa người dùng được chỉ định và người dùng đã xác thực.
Bắt buộc. Tên tài nguyên của người dùng để tìm tin nhắn trực tiếp.
Định dạng: users/{user}, trong đó {user} là id cho người trong API People hoặc id cho người dùng trong API Directory. Ví dụ: nếu mã hồ sơ API People là 123456789, bạn có thể tìm thấy tin nhắn trực tiếp với người đó bằng cách sử dụng users/123456789 làm name. Khi xác thực là người dùng, bạn có thể sử dụng email làm bí danh cho {user}. Ví dụ: users/example@gmail.com, trong đó example@gmail.com là email của người dùng Google Chat.
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của Space.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-05-07 UTC."],[[["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`."]]],["This outlines how to retrieve an existing direct message space with a specific user via the Chat API. Use a `GET` request to `https://chat.googleapis.com/v1/spaces:findDirectMessage`. Provide the target user's resource name in the `name` query parameter (e.g., `users/123456789`). The request body should be empty. Upon success, the response includes a `Space` resource. Requires either App or User authentication and specific OAuth scopes like `chat.spaces` or `chat.spaces.readonly`.\n"]]