docs: Add comprehensive API documentation#2362
Open
princevish wants to merge 1 commit intoEvolutionAPI:mainfrom
Open
docs: Add comprehensive API documentation#2362princevish wants to merge 1 commit intoEvolutionAPI:mainfrom
princevish wants to merge 1 commit intoEvolutionAPI:mainfrom
Conversation
Contributor
Reviewer's GuideAdds a new comprehensive API_DOCUMENTATION.md file describing all major Evolution API endpoints, parameters, and example request payloads, with special emphasis on correct usage of the :instance path parameter and how to discover instance names. Sequence diagram for using instance-based message API flowsequenceDiagram
actor Developer
participant EvolutionAPI
Developer->>EvolutionAPI: GET /instance/fetchInstances
EvolutionAPI-->>Developer: 200 OK (list of instances with name, status)
Developer->>Developer: Select active instance.name
Developer->>EvolutionAPI: POST /message/sendText/:instance
activate EvolutionAPI
EvolutionAPI->>EvolutionAPI: Validate apikey and instance name
EvolutionAPI-->>Developer: 200 OK (message queued/sent)
deactivate EvolutionAPI
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Several of the
jsoncode examples include//comments inside the objects (e.g."token": "random-token", // optional), which is invalid JSON and may confuse users or tools that copy/paste them; consider moving these notes to text around the snippet instead of inline. - The file ends with three empty fenced code blocks (multiple trailing ``` markers) after the Integrations section, which looks like a markdown formatting mistake and may break rendering in some viewers; it would be good to clean these up.
- For endpoints that accept multiple allowed string values (e.g.
presence,mediatype,status,category,action), it might be clearer and less error-prone to list the allowed values in a short bullet list or note under each endpoint rather than as inline comments in the JSON.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Several of the `json` code examples include `//` comments inside the objects (e.g. `"token": "random-token", // optional`), which is invalid JSON and may confuse users or tools that copy/paste them; consider moving these notes to text around the snippet instead of inline.
- The file ends with three empty fenced code blocks (multiple trailing ``` markers) after the Integrations section, which looks like a markdown formatting mistake and may break rendering in some viewers; it would be good to clean these up.
- For endpoints that accept multiple allowed string values (e.g. `presence`, `mediatype`, `status`, `category`, `action`), it might be clearer and less error-prone to list the allowed values in a short bullet list or note under each endpoint rather than as inline comments in the JSON.
## Individual Comments
### Comment 1
<location> `API_DOCUMENTATION.md:28-31` </location>
<code_context>
+ "token": "random-token", // optional
+ "number": "919876543210", // optional
+ "integration": "WHATSAPP-BAILEYS",
+ "qrcode": true // fetch qrcode immediately
+}
+```
</code_context>
<issue_to_address>
**suggestion (typo):** Use consistent spelling for “QR code” in the inline comment.
The `"qrcode"` field name should stay as-is for API compatibility, but please update the inline comment to `// fetch QR code immediately` for consistency with the rest of the documentation.
```suggestion
"integration": "WHATSAPP-BAILEYS",
"qrcode": true // fetch QR code immediately
}
```
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
+28
to
+31
| "integration": "WHATSAPP-BAILEYS", | ||
| "qrcode": true // fetch qrcode immediately | ||
| } | ||
| ``` |
Contributor
There was a problem hiding this comment.
suggestion (typo): Use consistent spelling for “QR code” in the inline comment.
The "qrcode" field name should stay as-is for API compatibility, but please update the inline comment to // fetch QR code immediately for consistency with the rest of the documentation.
Suggested change
| "integration": "WHATSAPP-BAILEYS", | |
| "qrcode": true // fetch qrcode immediately | |
| } | |
| ``` | |
| "integration": "WHATSAPP-BAILEYS", | |
| "qrcode": true // fetch QR code immediately | |
| } |
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.
📋 Description
This PR introduces a comprehensive
API_DOCUMENTATION.mdfile to the project. It provides detailed documentation for the Evolution API, covering all major modules including Instances, Messages, Groups, Chats, Business, and Integrations. The documentation includes endpoint descriptions, HTTP methods, route parameters, and JSON request body examples.Key clarifications added:
:instanceURL parameter refers to the Instance Name, not the ID.fetchInstances.🔗 Related Issue
Closes #(issue_number)
🧪 Type of Change
🧪 Testing
Verification Details:
src/api/routes/*.router.ts.src/api/dto/*.dto.ts.📸 Screenshots (if applicable)
✅ Checklist
📝 Additional Notes
This documentation serves as a centralized reference for developers and users to interact with the API effectively without needing to read the source code for every request structure.
Summary by Sourcery
Add a comprehensive API documentation guide for the Evolution API, covering core endpoints and usage conventions.
Documentation: