Swagger (OpenAPI)
Whinself provides comprehensive API documentation using Swagger/OpenAPI, making it easy to understand and interact with all available endpoints.
Accessing the API Documentation
The Swagger documentation is available directly from your Whinself instance:
http://WHINSELF_IP:PORT/api-docs/
This interactive documentation allows you to:
- Browse all available API endpoints
- See required parameters and response formats
- Test API calls directly from the browser
- Understand authentication requirements
Key API Categories
The Whinself API is organized into the following categories:
Messaging Endpoints
- Send Message:
/wspout
- Send text messages, media, and interactive content - Read Messages: Access received message data
- Reactions: Manage message reactions
Contact Management
- Get Contacts: Retrieve WhatsApp contact information
- Contact Status: Check contact online/offline status
- Profile Pictures: Get and set profile pictures
Group Operations
- Create Group: Create new WhatsApp groups
- Manage Members: Add or remove group participants
- Group Info: Get group metadata and settings
Status and Configuration
- Connection Status: Check WhatsApp connection status
- Webhook Configuration: Configure webhook URLs
- System Health: Get system health information
Authentication
Currently, the Whinself API uses simple authentication methods:
- Direct Access: When accessing from trusted networks
- API Key: Custom implementation when placing behind API gateways
- Proxied Authentication: When using with reverse proxies like Nginx
Using Swagger UI
To explore and test the API:
- Navigate to the API documentation URL
- Browse the available endpoints by category
- Click on an endpoint to expand its details
- Review parameters and response schemas
- Click "Try it out" to test the endpoint
- Fill in required parameters
- Execute the request and view results
Example API Calls
Sending a Text Message
curl -X POST http://WHINSELF_IP:PORT/wspout \
-H "Content-Type: application/json" \
-d '{
"text": "Hello from the API!",
"jid": "[email protected]"
}'
Sending an Image
curl -X POST http://WHINSELF_IP:PORT/wspout \
-H "Content-Type: application/json" \
-d '{
"image": {
"url": "https://example.com/image.jpg"
},
"caption": "Check out this image!",
"jid": "[email protected]"
}'
Getting Connection Status
curl http://WHINSELF_IP:PORT/status
API Client Generation
The OpenAPI specification allows you to generate API clients for various languages:
- Download the OpenAPI specification from
/api-docs/swagger.json
- Use tools like OpenAPI Generator or Swagger Codegen to create clients
- Integrate generated clients into your applications
API Versioning
Whinself maintains API stability through careful versioning:
- API changes are documented in release notes
- Breaking changes are clearly marked
- The Swagger documentation always reflects the current API version
Disclaimer: The Whinself API is an unofficial interface for interacting with WhatsApp and is not an official WhatsApp API. This is a third-party tool that uses your own WhatsApp account credentials and is not affiliated with, authorized, maintained, sponsored, or endorsed by WhatsApp or Meta Platforms, Inc.