AI-generated Key Takeaways
-  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 namequery parameter using specific formats.
-  Uses a GETHTTP request to thehttps://chat.googleapis.com/v1/spaces:findDirectMessageendpoint with gRPC Transcoding syntax.
-  Needs authorization with specific OAuth scopes like chat.spaces,chat.spaces.readonly, orchat.bot.
Returns the existing direct message with the specified user. If no direct message space is found, returns a 404 NOT_FOUND 
error. For an example, see Find a direct message 
.
With app authentication , returns the direct message space between the specified user and the calling Chat app.
With user authentication , returns the direct message space between the specified user and the authenticated user.
Supports the following types of authentication :
-  App authentication with the authorization scope: -  https://www.googleapis.com/auth/chat.bot
 
-  
-  User authentication with one of the following authorization scopes: -  https://www.googleapis.com/auth/chat.spaces.readonly
-  https://www.googleapis.com/auth/chat.spaces
 
-  
HTTP request
 GET https://chat.googleapis.com/v1/spaces:findDirectMessage 
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
| name |   Required. Resource name of the user to find direct message with. Format:  | 
Request body
The request body must be empty.
Response body
If successful, the response body contains an instance of  Space 
 
.
Authorization scopes
Requires one of the following OAuth scopes:
-  https://www.googleapis.com/auth/chat.spaces
-  https://www.googleapis.com/auth/chat.spaces.readonly
-  https://www.googleapis.com/auth/chat.bot
For more information, see the Authorization guide .

