Add endpoint to retrieve chat data by remoteJid#1743
Merged
DavidsonGomes merged 2 commits intoEvolutionAPI:developfrom Jul 21, 2025
Merged
Add endpoint to retrieve chat data by remoteJid#1743DavidsonGomes merged 2 commits intoEvolutionAPI:developfrom
DavidsonGomes merged 2 commits intoEvolutionAPI:developfrom
Conversation
Contributor
Reviewer's GuideIntroduces a findChatByRemoteJid endpoint by adding a route, controller method, and service query to fetch chat records by phone number with validation and error handling. Sequence diagram for the new findChatByRemoteJid API endpointsequenceDiagram
actor User
participant API as ChatRouter
participant Controller as ChatController
participant Service as ChannelStartupService
participant DB as PrismaRepository
User->>API: GET /findChatByRemoteJid?remoteJid=...
API->>API: Validate remoteJid
API->>Controller: findChatByRemoteJid(instance, remoteJid)
Controller->>Service: findChatByRemoteJid(remoteJid)
Service->>DB: chat.findFirst({ instanceId, remoteJid })
DB-->>Service: Chat record or null
Service-->>Controller: Chat record or null
Controller-->>API: Chat record or null
API-->>User: 200 OK (chat data) or error
Class diagram for new and updated methods in chat retrievalclassDiagram
class ChatRouter {
+get('findChatByRemoteJid', ...)
}
class ChatController {
+findChatByRemoteJid(instance: InstanceDto, remoteJid: string)
}
class ChannelStartupService {
+findChatByRemoteJid(remoteJid: string)
}
ChatRouter --> ChatController : calls
ChatController --> ChannelStartupService : calls
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new API endpoint called
findChatByRemoteJid, which allows retrieving chat information using a phone number (identified internally asremoteJid).What's included:
findChatByRemoteJidremoteJidThis functionality will be useful for querying specific chats directly by their associated phone number.
Summary by Sourcery
Add a new API endpoint to retrieve chat records by remoteJid, including route, controller, and service implementations with input validation and error handling.
New Features: