Skip to content
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

[Feature Request][ALL] - Consistent API Responses for sendText (and other API) - WAMessage Object as response of sendText #760

Open
francescolovecchio opened this issue Jan 28, 2025 · 3 comments
Labels
engine:ALL Related to all engines or basic mechanisms enhancement New feature or request patron:PLUS

Comments

@francescolovecchio
Copy link

francescolovecchio commented Jan 28, 2025

Describe the bug

When I send a message to /api/sendText I expect a WAMessage as response but I find:

{
  "key": {
    "remoteJid": "111111111111@s.whatsapp.net",
    "fromMe": true,
    "id": "3EB08A6895830F110A5E4D"
  },
  "message": {
    "extendedTextMessage": {
      "text": "Hi there!"
    }
  },
  "messageTimestamp": "1738070128",
  "status": "PENDING"
}

Version

{
  "version": "2025.1.6",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": "/usr/bin/chromium"
}

Steps

To Reproduce Steps to reproduce the behavior:

Send /api/sendText and check the response.

Expected behavior

I expect to receive a WAMessage as response when sending a message. If not expected, from the docs I didn't find any reference.

patron:PLUS

@francescolovecchio francescolovecchio added the bug Something isn't working label Jan 28, 2025
@devlikepro
Copy link
Contributor

devlikepro commented Jan 29, 2025

Hi! Yes, right now it's a bit different response (it returns pure _data field from message event, basiclly)
We kept it for now for backward compatability, all engines send their own format in "sendSomething" apis.

We'll add a new API for that in the future, had this in our roadmap for years... 👍

patron:PRO

@devlikepro devlikepro changed the title [BUG][NOWEB] - WAMessage Object as response of sendText [Feature Request][ALL] - Consistent API Responses for sendText (and other API) - WAMessage Object as response of sendText Jan 29, 2025
@devlikepro devlikepro added enhancement New feature or request engine:ALL Related to all engines or basic mechanisms and removed bug Something isn't working labels Jan 29, 2025
@francescolovecchio
Copy link
Author

francescolovecchio commented Jan 29, 2025

Hi, thank you! Do you have an idea about the possible release date (less or more)?

If it is more than 1 month, could you share the schema of the response for NOWEB engine and share how the message id in the new format is build?

patron:PLUS

@devlikepro
Copy link
Contributor

devlikepro commented Jan 29, 2025

more than 1 month :(

There's no actual schema. You can combine key to get the id as following

{key.fromMe}_{key.remoteJid}_{key.id}

there' 4 parts for groups also, something like

{key.fromMe}_{key.remoteJid}_{key.id}_{key.participant}

You can listen to message.any event and when you send a message via sendText - compare it with message.any payload to find the right mapping

or in source code
https://github.com/devlikeapro/waha/blob/core/src/core/engines/noweb/session.noweb.core.ts#L1667-L1694

patron:PRO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine:ALL Related to all engines or basic mechanisms enhancement New feature or request patron:PLUS
Projects
None yet
Development

No branches or pull requests

2 participants