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

Implement Get all chats and Get all contacts in NOWEB engine #206

Closed muhdazrain closed 1 month ago

muhdazrain commented 10 months ago

Hi,

I ran by using NOWEB engine. I just discovered that when I tried to use these endpoints, it returned "The method is not implemented by the engine". In the documentation, I couldn't find what type of engine compatible for these endpoints.

Could you please advise wether is it possible to run this on NOWEB engine or not. Honestly, I preferred to use NOWEB rather than WEBJS.

Additional info, I purchased WAHA Plus on July 2023 and no update afterthat.

Thanks.

allburov commented 10 months ago

Hi! we're working on remote storage for NOWEB so we can save chats\contacts there. After that we'll add those methods too! https://github.com/devlikeapro/whatsapp-http-api/issues/41

Additional info, I purchased WAHA Plus on July 2023 and no update afterthat.

Here's a new version https://boosty.to/wa-http-api/posts/04d125c2-2c44-4b48-927d-2eda71e40119?share=post_link

muhdazrain commented 10 months ago

Hi! we're working on remote storage for NOWEB so we can save chats\contacts there. After that we'll add those methods too!

Oh so currently cannot use endpoint chats/contacts for NOWEB engine? Need to use WEBJS engine, right?

khushboo-scogo commented 10 months ago

hey @muhdazrain , I am planning to move from Webjs to the NoWeb version because of chromium memory leakage issues. I just wanted to know if get all /contacts and get all /groups api works on noweb or not?

muhdazrain commented 10 months ago

@khushboo-scogo reason I'm using NOWEB is because similar like you. However, recently I want to try to fetch contacts and also chats but it returned "The method is not implemented by the engine". Based on @allburov replied, I think have issue with storage which works in progress.

As for now, I don't have any idea for the solution

ksingh-scogo commented 10 months ago

@allburov Is there any solution to this ? or any work around

May be if NoWeb is not ready now , do you think the 3rd engine Venom has this covered ? and could be used in place of NoWeb ?

@allburov from maturity point of view is Venom a good choice ? compared to NoWeb

allburov commented 10 months ago

@muhdazrain hi!

Is there any solution to this ? or any work around

The workaround would be to expose chat.updates and other internal engine's events, so you can listen all of them and save it in your database. First time when you authenticate session with QR it'll send your tone of chats\contacts and after that will send events about all updates there. Let me know if you're interested in it, we could expose those events, so you can enable it by adding engine.{engine.event.name} in webhook's events.

from maturity point of view is Venom a good choice ? compared to NoWeb

First of all, Venom (as webjs) uses chrome to communicate with whatsapp, so from performance CPU\Memory consumption it's the same as webjs. But Venom was much slower, we even stopped update that engine in WAHA... Like first QR appeared only after a minute... Let me know if you'd love to test venom, I'll update it!

btw, I don't remember whether or not it supports those endpoints anyway... We'll document it in documentation in swagger https://github.com/devlikeapro/whatsapp-http-api/issues/207

ksingh-scogo commented 10 months ago

@allburov Thanks for the update.

Good to know that Venon (as well) uses chrome to communicate. So its a no-go.

Like @muhdazrain we are also interested in getting NoWeb to work with chat, contacts, groups APIs working in NoWeb.

How should be approach this ? we are happy to be the beta tester for this , if you can push some fixes to NoWeb to support chat, contacts, groups APIs.

Thanks again @allburov for our prompt support on this

devlikepro commented 1 month ago

Start a brand new session - meaning call POST /api/sessions/logout before and POST /api/sessions/start with payload

{
  "name": "default",
  "config": {
    "noweb": {
      "enabled": {
        "store": true,
        "fullSync": false
      }
    }
  }
}

After that you'll have access those endpoints on NOWEB engine


https://waha.devlike.pro/docs/overview/changelog/#20246

You asked it, we did it - contacts, chats, and messages endpoints are now available in NOWEB engine! Please make sure to Enable NOWEB Store before using these endpoints.

patron:PRO