whatsapp-api
                                
                                 whatsapp-api copied to clipboard
                                
                                    whatsapp-api copied to clipboard
                            
                            
                            
                        export all existing chat
HI, Can I export all existing chats? I tried the "/client/getChats/{sessionId}" feature only today?
The /client/getChats/{sessionId} endpoint is exactly what you need. The response will contain only the last message in the chat session, so you need fetch all messages using the /chat/fetchMessages/{sessionId} endpoint additionally.
Does fetchMessages return all messages, regardless if there's 1 or 100,000 ?
@SnakeO yes, it should return all messages that's why you have to pass the searchOptions option to apply the limit.
See https://docs.wwebjs.dev/Chat.html#fetchMessages