-
Notifications
You must be signed in to change notification settings - Fork 5.3k
docs: Add comprehensive API documentation #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
docs: Add comprehensive API documentation #2362
Conversation
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| "integration": "WHATSAPP-BAILEYS", | ||
| "qrcode": true // fetch qrcode immediately | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| "integration": "WHATSAPP-BAILEYS", | |
| "qrcode": true // fetch qrcode immediately | |
| } | |
| ``` | |
| "integration": "WHATSAPP-BAILEYS", | |
| "qrcode": true // fetch QR code immediately | |
| } |
📋 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: