devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
831 stars 254 forks source link

[feature] ability to delete message via api #209

Closed ehussain closed 3 months ago

ehussain commented 10 months ago

Hello,

We are looking for API where we can delete the outgoing messages.

We receive a delete webhook for messages sent by client (any incoming message), however there is no way to delete the message which is sent from us via api.

We can have option to delete by message_id, and signature can look like this.

[DELETE] /message
{"id": "false_xxx@xx"} 
devlikepro commented 3 months ago

Hi! You can edit and delete messages starting WAHA Plus 2024.3.11! :tada: Remember to update and restart your containers to use the feature.


Edit message

You can edit text messages or "caption" in media messages.

PUT /api/{session}/chats/{chatId}/messages/{messageId}

👉 Remember to escape @ in chatId and messageId with %40.

So if you want to edit true_123@c.us_AAA message in 123@c.us chat you need to send request to:

PUT /api/{session}/chats/123%40c.us/messages/true_123%40c.us_AAA

Payload:

{
  "text": "Hello, world!"
}

Delete message

You can delete messages from the chat.

DELETE /api/{session}/chats/{chatId}/messages/{messageId}

👉 Remember to escape @ in chatId and messageId with %40.

So if you want to delete true_123@c.us_AAA message in 123@c.us chat you need to send request to:

DELETE /api/{session}/chats/123%40c.us/messages/true_123%40c.us_AAA

patron:PRO