WAHA 2024.11
Posted in Releases on November 30, 2024 by devlikeapro ‐ 2 min read
🎉 We are thrilled to announce the release of WAHA 2024.11 🎉
Event Monitor
Now you can observe the Events happening in your WAHA instance in real-time with the new Event Monitor feature!
Open dashboard/event-monitor or at your local instance http://localhost:3000/dashboard/event-monitor
Websockets
WAHA now has full support for Websockets!
Here’s how you can listen to it using websocat
# Listen all sessions and events
# -E to end the connection when the server closes it
websocat -E ws://localhost:3000/ws
Or JavaScript
// Configuration
const apiKey = '123'; // Replace with your API key
const baseUrl = 'ws://localhost:3000/ws';
const session = '*'; // Use '*' to listen to all sessions
const events = ['session.status', 'message']; // List of events to listen to
// Construct the WebSocket URL with query parameters
const queryParams = new URLSearchParams({
'x-api-key': apiKey,
session,
...events.reduce((acc, event) => ({ ...acc, events: event }), {}) // Add multiple 'events' params
});
const wsUrl = `${baseUrl}?${queryParams.toString()}`;
// Initialize WebSocket connection
const socket = new WebSocket(wsUrl);
// Handle incoming messages
socket.onmessage = (event) => {
console.log('Received:', event.data);
};
// Handle errors
socket.onerror = (error) => {
console.error('WebSocket Error:', error);
};
// Handle connection open
socket.onopen = () => {
console.log('WebSocket connection established:', wsUrl);
};
// Handle connection close
socket.onclose = () => {
console.log('WebSocket connection closed');
};
Manage Labels
Now you can manage (create, update, delete) 🏷️ Labels using WAHA API!
Create Label
POST /api/{session}/labels
Using color
{
"name": "New Client",
"color": 1
}
Using colorHex
{
"name": "New Client",
"colorHex" : "#64c4ff"
}
Update Label
PUT /api/{session}/labels/{labelId}
Using color
{
"name": "New Client",
"color": 1
}
Using colorHex
{
"name": "New Client",
"colorHex" : "#64c4ff"
}
Delete Label
DELETE /api/{session}/labels/{labelId}
Pin Message
You can 💬 Pin and Unpin Messages in WAHA now!
Pin message
POST /api/{session}/chats/{chatId}/messages/{messageId}/pin
Payload:
{
"duration": 86400
}
- 24 hours -
duration=86400
- 7 days -
duration=604800
- 30 days -
duration=2592000
Response:
{
"success": true
}
Unpin message
POST /api/{session}/chats/{chatId}/messages/{messageId}/unpin
Response:
{
"success": true
}
And More!
Check out the full WAHA 2024.11 🆕 Changelog for more details!