Open heureka-dev opened 2 weeks ago
Added limit
and offset
parameters to GET /api/{session}/chats
endpoint.
2024.6.4
Get all chats
GET /api/{session}/chats
limit
- limit the number of chats to returnoffset
- skip the number of chats from the startIf you see timeout or the request takes too long - consider using limit
parameter to get chats in smaller chunks
GET /api/{session}/chats?limit=100&offset=0
Is your feature request related to a problem? Please describe. Some of our accounts have thousands of active chats and contacts. Currently we're using WebJS, however the whole container crashes when we try to query the /chats and /contacts endpoints.
Describe the solution you'd like
The ability to either set a limit (maybe v1? of this?) in the query to these endpoints would be a good starting point, however in the future I'd love to see a pagination of some sorts.
As far as I can see WhatsApp Web uses some sort of "infinite load" pagination.
Additionally, maybe a search would be good too for both chats and contacts in case we are looking for one where we don't know the ID.
Describe alternatives you've considered
The alternative would be to not use these endpoints if your WhatsApp account have more chats/contacts then the system can handle.
Additional context We're running Whapi Plus on a 64GB Ram, 8 CPU machine, and the current ram utlization is arount 20 GB, while the CPU is around 15%, so well below the limits of the VPS.
Thank you!